Tunisia Phone Number Format: +216 Country Code Validation Guide
Complete guide to Tunisia phone number format with +216 country code, 8-digit validation, area codes, and regex patterns. Learn E.164 formatting, operator prefixes (Tunisie Telecom, Ooredoo, Orange), mobile number portability, and implementation code for developers.
Tunisia uses the +216 country code with an 8-digit phone number format for all standard numbers. This comprehensive guide covers everything developers need to validate, format, and handle Tunisian phone numbers correctly—from understanding area codes and operator prefixes to implementing Mobile Number Portability (MNP) and E.164 compliance.
Whether you're building authentication systems, SMS platforms, or call routing applications, you'll learn how to validate +216 numbers, implement proper formatting, handle carrier-specific routing, and integrate with Tunisia's telecommunications regulations managed by INT (Instance Nationale des Télécommunications).
Background on Tunisia's Telecommunications Landscape
Understand Tunisia's regulatory environment to implement reliable phone number handling. Tunisia's telecommunications sector operates under INT (Instance Nationale des Télécommunications) oversight, ensuring standardized numbering practices and consumer protection.
Internet subscribers: Over 12.3 million as of 2022, with 81.3% accessing via smartphones
Regulatory Framework:
The sector is regulated by INT (Instance Nationale des Télécommunications), Tunisia's telecommunications regulatory authority established under Tunisian law. INT oversees:
July 2024: INT issued Decision Coll-Reg-2024-08 establishing new numbering plan management rules (INT official announcement)
5G Planning: Tunisia announced plans to launch 5G licenses by end of 2024, with INT completing feasibility studies on social and economic impact
Technical Standards:
Country code: +216 (ITU-T E.164 compliant, registered with ITU)
Number structure: 8-digit National Significant Number (NSN)
MNP status: Fully operational across all 4 operators since implementation
Emergency services: Standardized 1XX format (190, 193, 197, 198) per national regulations
Check INT's official website (intt.tn) for the latest regulatory updates, numbering plan changes, and operator licensing information.
Number Formats in Tunisia
How many digits is a Tunisia phone number? All Tunisian phone numbers use exactly 8 digits (the National Significant Number or NSN), preceded by the +216 country code for international dialing. Tunisia follows ITU-T E.164, the international standard for telephone numbering.
E.164 Structure:
Component
Value
Notes
Country Code
+216
Required for international dialing
NSN Length
8 digits
No area code/subscriber split
International Format
+216 XX XXX XXX
Use for storage and APIs
National Format
XX XXX XXX
Use for local display
Key characteristics:
Uniform length: All standard numbers use exactly 8 digits (emergency numbers use 3)
No area code split: The 8-digit NSN is not divided into area code and subscriber number
Predictable patterns: First 2 digits identify number type (landline, mobile, special service)
E.164 compliance: Mandatory for all operators per INT regulations
This consistent structure simplifies parsing, validation, and international dialing integration.
Geographic Numbers (Landlines)
Identify landline regions using the first two digits of the 8-digit NSN. Geographic numbers always start with 7 followed by a region digit (1-8).
Regional Prefix Map:
Prefix
Region
Major Cities/Governorates
71
Greater Tunis
Tunis, Ariana, Ben Arous, Manouba
72
Northern Tunisia
Bizerte, Béja, Jendouba, Kef, Siliana
73
Central-East Coast
Sousse, Monastir, Mahdia, Kairouan
74
South-East
Sfax, Gabès, Médenine, Tataouine
75
Central-West
Kasserine, Sidi Bouzid, Gafsa
76
North-West
Zaghouan, Nabeul
77
Reserved/Special
Reserved for future allocation
78
South-West
Tozeur, Kébili
Format Patterns:
Structure:7X XXX XXX (7 + region digit + 6 digits)
Example:71 234 567 (Greater Tunis region)
International:+216 71 234 567
Validation Regex:
Regex
^7[1-8]\d{6}$
Note: Legacy patterns include 3[0-2] for special geographic prefixes. For standard landline validation, use 7[1-8] patterns exclusively.
Implementation strategy:
Extract first 2 digits to identify region
Validate 8-digit length requirement
Confirm prefix matches 7[1-8] pattern
Store in E.164 format: +21671234567
Mobile Numbers
Tunisian mobile numbers start with 2, 4, 5, or 9 followed by 7 more digits. Validate mobile numbers using operator-allocated prefixes, but never rely on prefixes for carrier identification due to Mobile Number Portability (MNP).
Operator Prefix Allocations (INT-assigned):
Prefix Range
Original Operator
Launch Year
Notes
20-29
Tunisie Telecom
Legacy
State-owned incumbent
50-59
Ooredoo Tunisia
2002
Formerly Tunisiana
90-99
Orange Tunisia
2010
Third major operator
40-49
Lycamobile/Reserved
2010s
Smaller operator/future allocation
Format Patterns:
Structure:XX XXX XXX (8 digits total)
Example:20 123 456 (originally Tunisie Telecom)
International:+216 20 123 456
Validation Regex:
Regex
^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$
Critical: MNP Impact on Development
⚠️ Operator prefixes no longer guarantee the current carrier. A number starting with 20 (Tunisie Telecom allocation) may now be served by Ooredoo or Orange after porting.
Query MNP database for current operator (if carrier identification needed)
Cache MNP results for 24-48 hours to optimize performance
Implement fallback to prefix-based lookup if MNP query fails
Use prefix-based identification only as a fallback when MNP lookup services are unavailable.
Emergency Service Numbers
Never block or filter emergency numbers in your application. Tunisia uses standardized 1XX emergency numbers accessible from any device, including phones without SIM cards or with blocked accounts.
Allow emergency calls even when device has no credit, no SIM, or blocked account
Never apply rate limiting to emergency number dialing attempts
Prioritize routing for emergency calls over regular traffic
Route at no charge – operators must handle emergency calls free of charge
Implementation Checklist:
✅ Exclude emergency numbers from validation that blocks "invalid" numbers
✅ Allow emergency calls in offline/airplane mode
✅ Skip authentication requirements for emergency dialing
✅ Disable call duration limits for emergency numbers
✅ Log emergency call attempts for compliance auditing
Testing Guidelines:
❌ Never test with live emergency calls – you'll tie up actual emergency services
✅ Use INT-approved test numbers – request from INT or your operator
✅ Simulate emergency routing in development environments
✅ Test validation bypass – ensure emergency numbers pass through filters
Validation pattern:
Regex
^(190|193|197|198)$
Handle emergency numbers as a distinct category in your validation logic – they follow 3-digit format unlike standard 8-digit numbers.
Special Service Numbers
Identify and handle special service numbers separately due to billing implications. These 8X prefix numbers have distinct charging models regulated by INT.
Service Types and Billing Models:
Prefix
Service Type
French Name
Billing Model
Use Cases
80
Toll-Free
Numéro Vert
Caller: Free / Recipient: Full cost
Customer support, hotlines
81
Shared Cost
Numéro Azur
Caller: Partial / Recipient: Partial
Technical support, information lines
88
Premium Rate
Numéro Indigo
Caller: Premium rates
Entertainment, paid information services
Format Patterns:
Structure:8X XXX XXX (80/81/88 + 6 digits)
Examples:
Toll-free: 80 100 123
Shared cost: 81 234 567
Premium rate: 88 123 456
Validation Regex:
Regex
^(80|81|88)\d{6}$
Regulatory Compliance (INT Requirements):
You must:
Display cost warnings before connecting premium rate (88) calls
Obtain user consent before dialing premium rate numbers
Provide cost information – show per-minute rates when available
// Example: Show warning before premium rate callfunctiondialSpecialService(number) {
const prefix = number.substring(0, 2);
if (prefix === '88') {
// Required: Display warning for premium rateshowWarning('Premium rate call. Higher charges apply. Continue?');
} elseif (prefix === '81') {
showInfo('Shared cost call. Standard rates apply.');
}
// 80 (toll-free) requires no warning// Proceed with call after user confirmation
}
Billing Distinction:
Validation: Treat special service numbers as valid but distinct from mobile/landline
Routing: May use different routing paths than standard calls
Display: Label clearly (e.g., "Toll-Free", "Premium Rate") in call logs
Analytics: Track separately for billing analysis and fraud detection
Implement clear visual indicators (icons, colors, text labels) to distinguish premium rate numbers from standard calls.
Implementation Guide for Developers
Implement Tunisian phone number handling with these production-ready code examples. All examples follow E.164 standards and INT regulatory requirements.
Validation and Formatting in JavaScript
Here's how to validate and format Tunisian phone numbers using JavaScript with E.164 compliance:
This validation function handles all Tunisian number types and strips common formatting before validation.
Number Formatting (E.164 and Local):
JavaScript
functionformatTunisianNumber(number, format = 'local') {
// Remove all non-digit characterslet cleaned = number.replace(/\D/g, '');
// Remove country code if presentif (cleaned.startsWith('216')) {
cleaned = cleaned.substring(3);
}
// Handle emergency numbers (3 digits)if (cleaned.length === 3 && /^(190|193|197|198)$/.test(cleaned)) {
return cleaned; // Emergency numbers don't need formatting
}
// Validate length (must be 8 digits for standard numbers)if (cleaned.length !== 8) {
thrownewError('Invalid Tunisian phone number length. Expected 8 digits.');
}
// Format based on requested outputswitch (format) {
case'e164':
// ITU-T E.164 international formatreturn`+216${cleaned}`;
case'international':
// International format with spacingreturn`+216 ${cleaned.slice(0, 2)}${cleaned.slice(2, 5)}${cleaned.slice(5)}`;
case'local':
default:
// Local format with spacingreturn`${cleaned.slice(0, 2)}${cleaned.slice(2, 5)}${cleaned.slice(5)}`;
}
}
// Example usageconsole.log(formatTunisianNumber("20123456", "e164")); // Output: +21620123456console.log(formatTunisianNumber("20123456", "international")); // Output: +216 20 123 456console.log(formatTunisianNumber("+216 71 234 567", "local")); // Output: 71 234 567console.log(formatTunisianNumber("190")); // Output: 190 (emergency numbers unchanged)
This enhanced formatter supports E.164 format (required for international SMS/voice APIs), international display format, and local Tunisian format.
Advanced Implementation with TypeScript
For type-safe phone number handling, define comprehensive interfaces and enums:
TypeScript
// Enum for number typesenumTunisianNumberType {
MOBILE = 'mobile',
LANDLINE = 'landline',
TOLL_FREE = 'toll_free',
SHARED_COST = 'shared_cost',
PREMIUM_RATE = 'premium_rate',
EMERGENCY = 'emergency'
}
// Enum for operators (note: MNP means prefix doesn't guarantee current operator)enumMobileOperator {
TUNISIE_TELECOM = 'Tunisie Telecom',
OOREDOO = 'Ooredoo',
ORANGE = 'Orange Tunisia',
LYCAMOBILE = 'Lycamobile',
UNKNOWN = 'Unknown'
}
// Geographic regions for landlinesenumGeographicRegion {
TUNIS = 'Greater Tunis',
NORTH = 'Northern Tunisia',
CENTRAL_EAST = 'Central-East Coast',
SOUTH_EAST = 'South-East',
CENTRAL_WEST = 'Central-West',
NORTH_WEST = 'North-West',
SOUTH_WEST = 'South-West'
}
// Main phone number interfaceinterfaceTunisianPhoneNumber {
countryCode: '+216';
nsn: string; // National Significant Number (8 digits)numberType: TunisianNumberType;
allocatedOperator?: MobileOperator; // Prefix-based operator (may differ due to MNP)currentOperator?: MobileOperator; // Actual operator (requires MNP lookup)region?: GeographicRegion; // For landline numberse164Format: string; // +21620123456localFormat: string; // 20 123 456
}
// Validation result interfaceinterfaceValidationResult {
valid: boolean;
numberType?: TunisianNumberType;
errors: string[];
warnings: string[];
}
// Example class with validation methodsclassTunisianPhoneValidator {
staticvalidate(number: string): ValidationResult {
const cleaned = number.replace(/[\s\-+]/g, '').replace(/^216/, '');
consterrors: string[] = [];
constwarnings: string[] = [];
letnumberType: TunisianNumberType | undefined;
// Emergency numbersif (/^(190|193|197|198)$/.test(cleaned)) {
return { valid: true, numberType: TunisianNumberType.EMERGENCY, errors: [], warnings: [] };
}
// Check 8-digit requirementif (cleaned.length !== 8) {
errors.push(`Invalid length: expected 8 digits, got ${cleaned.length}`);
return { valid: false, errors, warnings };
}
// Check number typeif (/^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$/.test(cleaned)) {
numberType = TunisianNumberType.MOBILE;
warnings.push('Operator prefix may not reflect current operator due to MNP');
} elseif (/^7[1-8]\d{6}$/.test(cleaned)) {
numberType = TunisianNumberType.LANDLINE;
} elseif (/^80\d{6}$/.test(cleaned)) {
numberType = TunisianNumberType.TOLL_FREE;
} elseif (/^81\d{6}$/.test(cleaned)) {
numberType = TunisianNumberType.SHARED_COST;
warnings.push('Shared cost number - caller and recipient split charges');
} elseif (/^88\d{6}$/.test(cleaned)) {
numberType = TunisianNumberType.PREMIUM_RATE;
warnings.push('Premium rate number - higher charges apply');
} else {
errors.push('Number does not match any known Tunisian format');
return { valid: false, errors, warnings };
}
return { valid: true, numberType, errors: [], warnings };
}
staticdetermineAllocatedOperator(nsn: string): MobileOperator {
const prefix = nsn.substring(0, 2);
if (/^2[0-9]$/.test(prefix)) returnMobileOperator.TUNISIE_TELECOM;
if (/^5[0-9]$/.test(prefix)) returnMobileOperator.OOREDOO;
if (/^9[0-9]$/.test(prefix)) returnMobileOperator.ORANGE;
if (/^4[0-9]$/.test(prefix)) returnMobileOperator.LYCAMOBILE;
returnMobileOperator.UNKNOWN;
}
staticgetRegion(nsn: string): GeographicRegion | undefined {
const prefix = nsn.substring(0, 2);
constregionMap: Record<string, GeographicRegion> = {
'71': GeographicRegion.TUNIS,
'72': GeographicRegion.NORTH,
'73': GeographicRegion.CENTRAL_EAST,
'74': GeographicRegion.SOUTH_EAST,
'75': GeographicRegion.CENTRAL_WEST,
'76': GeographicRegion.NORTH_WEST,
'78': GeographicRegion.SOUTH_WEST
};
return regionMap[prefix];
}
}
// Example usageconst result = TunisianPhoneValidator.validate('+216 20 123 456');
console.log(result);
// { valid: true, numberType: 'mobile', errors: [], warnings: ['Operator prefix may not reflect...'] }
This TypeScript implementation provides type safety, comprehensive validation, and clear error/warning messages for production applications.
Geographic Number Validation with Area Code Check
Enhance validation by verifying both format and area code validity:
JavaScript
// Validate geographic numbers with explicit area code checkingfunctionvalidateGeographicNumber(number) {
// Remove whitespace and formattingconst cleanNumber = number.replace(/\s+/g, '');
// Extract first 2 digits (area code)const areaCode = cleanNumber.substring(0, 2);
// Valid area codes: 71-78 (77 reserved but included)const validAreaCodes = ['71', '72', '73', '74', '75', '76', '77', '78'];
const hasValidArea = validAreaCodes.includes(areaCode);
// Check overall pattern: 7X followed by 6 digitsconst matchesPattern = /^7[1-8]\d{6}$/.test(cleanNumber);
return hasValidArea && matchesPattern;
}
// Test casesconsole.log(validateGeographicNumber('71234567')); // true (Tunis)console.log(validateGeographicNumber('72345678')); // true (Bizerte)console.log(validateGeographicNumber('79123456')); // false (79 not allocated)console.log(validateGeographicNumber('20123456')); // false (mobile number)
Validation strategy:
Normalize input – Remove spaces, hyphens, country code
Check length – Must be exactly 8 digits
Verify area code – First 2 digits must be in valid range (71-78)
Match pattern – Confirm structure with regex
Return boolean – True only if all checks pass
Use this two-stage validation (area code + pattern) to catch edge cases that simple regex might miss.
Handling Mobile Number Portability (MNP)
Implement MNP handling to ensure accurate carrier identification. Tunisia's MNP system, managed by INT (Instance Nationale des Télécommunications), allows subscribers to switch operators while keeping their phone numbers. All four major operators—Tunisie Telecom, Ooredoo, Orange Tunisia, and Lycamobile—participate in the MNP framework established by INT regulations.
MNP Status: Tunisia has implemented mobile number portability as confirmed by ITU DataHub 2024, making it mandatory for all licensed mobile operators.
Critical Concept: Operator prefixes no longer indicate the current carrier. You must query INT's MNP database or operator APIs for real-time carrier information.
MNP System Characteristics:
Impact on Development:
Prefix-based identification fails for ported numbers
Original allocation: 20 123 456 → Tunisie Telecom
After porting: 20 123 456 → May be Ooredoo, Orange, or Lycamobile
Consequence: Billing errors, routing failures, incorrect carrier-specific features
Real-time lookup required for carrier-dependent operations
MNP database source: INT centralized database
Access method: Operator APIs or third-party MNP services
Lookup latency: 50-200ms typical response time
Update frequency: Real-time (database updated within minutes of porting completion)
Porting process timeline and constraints
Processing time: 2-7 business days per INT regulations
User requirements: No outstanding debt, account active 3+ months
Notification: Users receive SMS confirmation when porting completes
Downtime: Minimal (typically <4 hours during porting window)
Implementation Best Practices:
JavaScript
// MNP lookup with caching and fallbackclassMNPLookupService {
constructor(apiKey, cacheTimeout = 86400000) { // 24-hour cachethis.apiKey = apiKey;
this.cache = newMap();
this.cacheTimeout = cacheTimeout;
}
asyncgetCurrentOperator(nsn) {
// Check cache firstconst cached = this.cache.get(nsn);
if (cached && Date.now() - cached.timestamp < this.cacheTimeout) {
return cached.operator;
}
try {
// Query INT MNP database or operator APIconst response = awaitfetch(`https://mnp-api.example.tn/lookup/${nsn}`, {
headers: { 'Authorization': `Bearer ${this.apiKey}` }
});
if (!response.ok) thrownewError('MNP lookup failed');
const data = await response.json();
const operator = data.currentOperator;
// Cache the resultthis.cache.set(nsn, { operator, timestamp: Date.now() });
return operator;
} catch (error) {
console.error('MNP lookup error:', error);
// Fallback to prefix-based determinationreturnthis.determineOperatorByPrefix(nsn);
}
}
determineOperatorByPrefix(nsn) {
const prefix = nsn.substring(0, 2);
if (/^2[0-9]$/.test(prefix)) return'Tunisie Telecom';
if (/^5[0-9]$/.test(prefix)) return'Ooredoo';
if (/^9[0-9]$/.test(prefix)) return'Orange Tunisia';
if (/^4[0-9]$/.test(prefix)) return'Lycamobile';
return'Unknown';
}
clearCache() {
this.cache.clear();
}
}
// Usage exampleconst mnpService = newMNPLookupService('your-api-key');
asyncfunctionprocessCall(phoneNumber) {
const nsn = phoneNumber.replace(/[\s\-+]/g, '').replace(/^216/, '');
// Get current operator via MNP lookupconst currentOperator = await mnpService.getCurrentOperator(nsn);
// Route call based on actual operatorconsole.log(`Routing call to ${currentOperator}`);
// ... routing logic
}
Caching Strategy:
Cache TTL: 24-48 hours balances accuracy with performance
Cache invalidation: Clear cache on MNP notification webhooks (if available)
Fallback: Always implement prefix-based fallback for lookup failures
Provide fallback routing if MNP service is unavailable
Respect user privacy (do not store MNP lookup results beyond operational needs)
Testing MNP Implementation:
INT provides test numbers for MNP validation:
Request test credentials from INT or your operator
Use sandbox MNP API for development
Test scenarios: ported numbers, non-ported numbers, lookup failures
Frequently Asked Questions
What is the country code for Tunisia?
Tunisia's country code is +216. This prefix must be used before the 8-digit National Significant Number (NSN) when dialing from outside Tunisia or storing numbers in international E.164 format. The +216 country code is also used for WhatsApp, international SMS, and all telecommunications services.
Examples:
Local format: 20 123 456
International format: +216 20 123 456
E.164 format: +21620123456
For WhatsApp and international services, always store phone numbers in E.164 format (+21620123456) for database consistency and API compatibility.
How do I validate a Tunisian mobile phone number?
Tunisian mobile numbers start with 2, 4, 5, or 9 followed by 7 more digits (8 digits total). Validate Tunisian mobile numbers using this regex pattern:
Regex
^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$
This pattern matches:
20-29: Tunisie Telecom numbers
40-49: Lycamobile/reserved numbers
50-59: Ooredoo numbers
90-99: Orange Tunisia numbers
Important: Due to Mobile Number Portability (MNP), the prefix no longer indicates the current operator. Use INT's MNP database or operator APIs for accurate carrier identification.
What are Tunisia's area codes for landline numbers?
Tunisia uses 8 geographic area codes for landlines, all starting with 7:
Area Code
Region
Major Cities
71
Greater Tunis
Tunis, Ariana, Ben Arous
72
Northern Tunisia
Bizerte, Béja, Jendouba
73
Central-East Coast
Sousse, Monastir, Kairouan
74
South-East
Sfax, Gabès, Médenine
75
Central-West
Kasserine, Sidi Bouzid, Gafsa
76
North-West
Zaghouan, Nabeul
77
Reserved/Special
Reserved for future use
78
South-West
Tozeur, Kébili
All landline numbers follow the format 7X XXX XXX (8 digits total).
How does Mobile Number Portability (MNP) work in Tunisia?
Tunisia's MNP system, managed by INT (Instance Nationale des Télécommunications), allows subscribers to switch operators while keeping their phone numbers. The porting process takes 2-7 business days.
Key points:
All 4 operators participate: Tunisie Telecom, Ooredoo, Orange Tunisia, Lycamobile
MNP confirmed operational:ITU DataHub 2024 confirms Tunisia has implemented mobile number portability
Prefix unreliability: A number with prefix 20 (originally Tunisie Telecom) may now be served by any operator
Real-time lookup required: Query INT's MNP database or operator APIs for accurate carrier identification
Lookup latency: 50-200ms typical response time
Developer impact:
Don't use prefixes for billing, routing, or carrier-specific features
Implement MNP lookup with 24-48 hour caching
Always provide fallback to prefix-based identification if MNP lookup fails
What are Tunisia's emergency numbers?
Tunisia uses standardized 3-digit emergency numbers accessible from any device, even without a SIM card:
190: Ambulance (SAMU - Emergency Medical Services)
Allow calls even when device has no credit or is offline
Don't apply rate limiting to emergency dialing
Route at no charge per INT regulations
Validation pattern:^(190|193|197|198)$
What's the difference between toll-free and premium rate numbers in Tunisia?
Tunisia uses three types of special service numbers with distinct billing models:
Toll-Free (80):
Format:80 XXX XXX
Billing: Caller pays nothing; recipient pays full cost
Use cases: Customer support, hotlines
Shared Cost (81):
Format:81 XXX XXX
Billing: Cost split between caller and recipient
Use cases: Technical support, information lines
Premium Rate (88):
Format:88 XXX XXX
Billing: Caller pays premium rates (higher than standard)
Use cases: Entertainment, paid information services
Regulatory requirement: INT mandates that applications display cost warnings before connecting premium rate (88) calls.
How do I convert a Tunisian phone number to E.164 format?
E.164 format is the international standard for phone numbers, required by most SMS APIs, WhatsApp Business API, and telecom systems. Convert Tunisian numbers to E.164 format by removing formatting and adding the +216 country code:
Conversion steps:
Remove spaces, hyphens, and other formatting: 20 123 456 → 20123456
Remove country code if already present: 21620123456 → 20123456
Status: Private operator (launched 2010, 51% Tunisian / 49% French)
Prefixes: 90-99
Market share: 22.9% (2022)
Parent company: Orange S.A. (France Télécom)
Lycamobile:
Status: MVNO/smaller operator
Prefixes: 40-49 (reserved range)
Market share: Insignificant
Focus: International calling, niche market
Important: Due to MNP, prefixes no longer guarantee current operator. Always use MNP lookup for accurate carrier identification.
What regex pattern validates all Tunisian phone numbers?
Use this comprehensive regex to validate all Tunisian number types:
JavaScript
// All standard numbers (8 digits)const allNumbersRegex = /^(2[0-9]|4[0-9]|5[0-9]|7[1-8]|80|81|88|9[0-9])\d{6}$/;
// Or validate by type:const mobileRegex = /^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$/;
const landlineRegex = /^7[1-8]\d{6}$/;
const specialServiceRegex = /^(80|81|88)\d{6}$/;
const emergencyRegex = /^(190|193|197|198)$/;
Pattern breakdown:
Mobile:(2[0-9]|4[0-9]|5[0-9]|9[0-9]) + 6 digits
Landline:7[1-8] + 6 digits
Special service:(80|81|88) + 6 digits
Emergency: Exactly 190, 193, 197, or 198
Best practice: Validate by number type rather than using a single catch-all pattern. This enables type-specific handling (MNP lookup for mobile, billing warnings for premium rate, etc.).
How often should I update my Tunisia phone number validation rules?
Update your validation logic on these schedules:
Quarterly: Check INT website (intt.tn) for new operator allocations or prefix assignments
Semi-annually: Review operator API documentation for MNP lookup changes
Monitor regulatory updates: INT issued Decision Coll-Reg-2024-08 in July 2024 establishing new numbering plan management rules
As-needed: Immediately when validation failures spike for legitimate numbers
Best practices:
Monitor INT announcements: Subscribe to INT or operator mailing lists
Version validation rules: Track changes with timestamps and source citations
Implement graceful degradation: Accept unknown but structurally valid numbers
Log validation failures: Track patterns that indicate numbering changes
Early warning signs:
Increased validation failures for numbers from specific prefixes
User reports of rejected valid numbers
Operator announcements of new number ranges
INT regulatory updates on numbering plan changes
Conclusion
Implement reliable Tunisian phone number handling using the validation patterns, MNP strategies, and regulatory compliance guidelines in this guide.
Implementation Priorities:
Store in E.164 format – Use +216XXXXXXXX for all database storage and API interactions
Validate number types – Distinguish mobile, landline, special service, and emergency numbers
Implement MNP lookup – Query INT database or operator APIs for carrier identification; cache 24-48 hours
Never block emergency numbers – Allow 190, 193, 197, 198 in all validation contexts
Display billing warnings – Show cost alerts for premium rate (88) numbers per INT requirements
Use TypeScript – Leverage type safety for production applications
Regulatory Compliance Resources:
INT (Instance Nationale des Télécommunications) regulates Tunisia's telecommunications sector. Access official resources:
INT website:intt.tn (Arabic/French) – official regulations and announcements
Latest regulations: Decision Coll-Reg-2024-08 (July 2024) on numbering plan management
Numbering plan: Request from INT or your operator – detailed prefix allocations
MNP technical specs: Contact INT or operator APIs – database query protocols
E.164 standard:ITU-T E.164 – international numbering format
Implement regex validation for all number types (mobile, landline, special, emergency)
Build or integrate MNP lookup service with caching
Test with numbers from all 4 operators (Tunisie Telecom, Ooredoo, Orange, Lycamobile)
Add emergency number bypass in all validation filters
Display billing warnings for premium rate numbers
Store all numbers in E.164 format (+216XXXXXXXX)
Implement fallback logic for MNP lookup failures
Monitor INT website for numbering plan updates
Set up cache invalidation strategy for MNP lookups
Test cross-operator scenarios (ported numbers)
Common Implementation Mistakes:
❌ Using prefixes for carrier identification – MNP makes this unreliable; always use MNP lookup
❌ Blocking emergency numbers – Violates INT regulations and creates safety risks
❌ Hard-coding operator prefixes – New allocations or operators render code obsolete
❌ Ignoring special service numbers – Billing disputes arise without proper warnings
❌ Not caching MNP lookups – Performance degrades and API costs increase unnecessarily
❌ Storing in local format – E.164 format required for international integration
❌ Skipping TypeScript – Type safety prevents entire categories of validation errors
Next Steps:
Test validation logic – Run test suite with valid/invalid numbers from all categories
Integrate MNP service – Set up operator API credentials or third-party MNP provider
Implement caching layer – Use Redis or similar with 24-48 hour TTL
Monitor INT announcements – Subscribe to operator mailing lists or INT updates
Deploy incrementally – Test with small traffic percentage before full rollout
Maintain compliance with INT regulations, implement robust MNP handling, and follow E.164 standards to build production-ready phone number validation for Tunisia's telecommunications market.
Frequently asked questions
The Tunisia country code is +216. This code precedes the 8-digit National Significant Number (NSN) when dialing internationally to Tunisia, ensuring the call is correctly routed.
Tunisian phone numbers locally are formatted as XX XXX XXX, separating the 8-digit NSN into three groups. For example, a Tunis landline number would be formatted as 71 234 567.
Use the regular expression /^(2[0-9]|5[0-9]|9[0-9])\d{6}$/ to validate Tunisian mobile numbers. This regex checks for the correct operator prefixes (20-29 for Tunisie Telecom, 50-59 for Ooredoo, and 90-99 for Orange) followed by six digits.
Regional prefixes for landlines (71-78) in Tunisia identify specific regions within the country. For instance, 71 designates the Greater Tunis Region while 72 points to Northern Tunisia. This system helps geographically categorize calls and services.
The emergency number for the police in Tunisia is 190. This number, along with other emergency numbers like 197 for fire and 198 for ambulance, are accessible 24/7 from any phone, even without a SIM card.
Toll-free numbers in Tunisia begin with the prefix 80, followed by six more digits (80 XXX XXX). Identifying these allows for special handling in applications, often excluding charges or applying alternative routing logic.
Consider MNP when building applications that require accurate operator information. Because users can keep their numbers when switching providers, relying solely on prefixes can be misleading. Using a real-time number lookup service or consulting the INT's SLA for MNP guidelines are crucial steps.
To format with the country code, remove all non-digit characters, then prepend '+216 ' and group the remaining digits: +216 XX XXX XXX. Example: +216 20 123 456. This ensures international compatibility.
The area code for the Greater Tunis Region in Tunisia is 71. This two-digit prefix is used for landline numbers within the capital and surrounding areas.
Special service numbers in Tunisia, like toll-free (80 XXX XXX), premium rate (88 XXX XXX), and shared cost (81 XXX XXX), require specific handling within applications. This might involve different billing logic or specialized routing compared to standard calls.
Tunisia has four primary mobile operators: Tunisie Telecom, Ooredoo, Orange Tunisia, and Lycamobile. This competitive market, combined with the government's efforts for digitalization, has resulted in a standardized numbering system.
You can determine the area code by examining the first two digits of the 8-digit National Significant Number (NSN). Valid area codes for geographic numbers range from 71 to 78, representing different regions across the country.
Understanding Tunisia's telecommunications system is crucial for developers as it allows them to correctly validate, format, and process phone numbers. The country's high mobile penetration rate and ongoing digitalization efforts make this knowledge even more important for effective integration.
Introduction
Tunisia uses the +216 country code with an 8-digit phone number format for all standard numbers. This comprehensive guide covers everything developers need to validate, format, and handle Tunisian phone numbers correctly—from understanding area codes and operator prefixes to implementing Mobile Number Portability (MNP) and E.164 compliance.
Whether you're building authentication systems, SMS platforms, or call routing applications, you'll learn how to validate +216 numbers, implement proper formatting, handle carrier-specific routing, and integrate with Tunisia's telecommunications regulations managed by INT (Instance Nationale des Télécommunications).
Table of Contents
Background on Tunisia's Telecommunications Landscape
Understand Tunisia's regulatory environment to implement reliable phone number handling. Tunisia's telecommunications sector operates under INT (Instance Nationale des Télécommunications) oversight, ensuring standardized numbering practices and consumer protection.
Market Overview (2024):
Regulatory Framework:
The sector is regulated by INT (Instance Nationale des Télécommunications), Tunisia's telecommunications regulatory authority established under Tunisian law. INT oversees:
Recent Regulatory Updates:
Technical Standards:
Check INT's official website (intt.tn) for the latest regulatory updates, numbering plan changes, and operator licensing information.
Number Formats in Tunisia
How many digits is a Tunisia phone number? All Tunisian phone numbers use exactly 8 digits (the National Significant Number or NSN), preceded by the +216 country code for international dialing. Tunisia follows ITU-T E.164, the international standard for telephone numbering.
E.164 Structure:
Key characteristics:
This consistent structure simplifies parsing, validation, and international dialing integration.
Geographic Numbers (Landlines)
Identify landline regions using the first two digits of the 8-digit NSN. Geographic numbers always start with
7followed by a region digit (1-8).Regional Prefix Map:
Format Patterns:
7X XXX XXX(7 + region digit + 6 digits)71 234 567(Greater Tunis region)+216 71 234 567Validation Regex:
Note: Legacy patterns include
3[0-2]for special geographic prefixes. For standard landline validation, use7[1-8]patterns exclusively.Implementation strategy:
7[1-8]pattern+21671234567Mobile Numbers
Tunisian mobile numbers start with 2, 4, 5, or 9 followed by 7 more digits. Validate mobile numbers using operator-allocated prefixes, but never rely on prefixes for carrier identification due to Mobile Number Portability (MNP).
Operator Prefix Allocations (INT-assigned):
Format Patterns:
XX XXX XXX(8 digits total)20 123 456(originally Tunisie Telecom)+216 20 123 456Validation Regex:
Critical: MNP Impact on Development
⚠️ Operator prefixes no longer guarantee the current carrier. A number starting with
20(Tunisie Telecom allocation) may now be served by Ooredoo or Orange after porting.Do NOT use prefixes for:
DO use MNP lookup for:
Implementation requirements:
Use prefix-based identification only as a fallback when MNP lookup services are unavailable.
Emergency Service Numbers
Never block or filter emergency numbers in your application. Tunisia uses standardized 1XX emergency numbers accessible from any device, including phones without SIM cards or with blocked accounts.
Emergency Numbers (24/7 Availability):
Source: U.S. Embassy Tunisia Emergency Assistance, UK Foreign Travel Advice, verified across multiple official government sources.
Regulatory Requirements (INT-Mandated):
Per INT regulations, you must:
Implementation Checklist:
✅ Exclude emergency numbers from validation that blocks "invalid" numbers ✅ Allow emergency calls in offline/airplane mode ✅ Skip authentication requirements for emergency dialing ✅ Disable call duration limits for emergency numbers ✅ Log emergency call attempts for compliance auditing
Testing Guidelines:
❌ Never test with live emergency calls – you'll tie up actual emergency services ✅ Use INT-approved test numbers – request from INT or your operator ✅ Simulate emergency routing in development environments ✅ Test validation bypass – ensure emergency numbers pass through filters
Validation pattern:
Handle emergency numbers as a distinct category in your validation logic – they follow 3-digit format unlike standard 8-digit numbers.
Special Service Numbers
Identify and handle special service numbers separately due to billing implications. These 8X prefix numbers have distinct charging models regulated by INT.
Service Types and Billing Models:
Format Patterns:
8X XXX XXX(80/81/88 + 6 digits)80 100 12381 234 56788 123 456Validation Regex:
Regulatory Compliance (INT Requirements):
You must:
Implementation Requirements:
// Example: Show warning before premium rate call function dialSpecialService(number) { const prefix = number.substring(0, 2); if (prefix === '88') { // Required: Display warning for premium rate showWarning('Premium rate call. Higher charges apply. Continue?'); } else if (prefix === '81') { showInfo('Shared cost call. Standard rates apply.'); } // 80 (toll-free) requires no warning // Proceed with call after user confirmation }Billing Distinction:
Implement clear visual indicators (icons, colors, text labels) to distinguish premium rate numbers from standard calls.
Implementation Guide for Developers
Implement Tunisian phone number handling with these production-ready code examples. All examples follow E.164 standards and INT regulatory requirements.
Validation and Formatting in JavaScript
Here's how to validate and format Tunisian phone numbers using JavaScript with E.164 compliance:
// Tunisian mobile numbers (20-29, 40-49, 50-59, 90-99) const mobileRegex = /^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$/; // Tunisian landline numbers (71-78 for standard geographic) const landlineRegex = /^7[1-8]\d{6}$/; // Special service numbers (80, 81, 88) const specialServiceRegex = /^(80|81|88)\d{6}$/; // Emergency numbers (190, 193, 197, 198) const emergencyRegex = /^(190|193|197|198)$/; // Validate any Tunisian number function validateTunisianNumber(number) { // Remove spaces, hyphens, and country code const cleaned = number.replace(/[\s\-+]/g, '').replace(/^216/, ''); return { isMobile: mobileRegex.test(cleaned), isLandline: landlineRegex.test(cleaned), isSpecialService: specialServiceRegex.test(cleaned), isEmergency: emergencyRegex.test(cleaned), isValid: mobileRegex.test(cleaned) || landlineRegex.test(cleaned) || specialServiceRegex.test(cleaned) || emergencyRegex.test(cleaned) }; } // Example usage console.log(validateTunisianNumber("20123456")); // { isMobile: true, isLandline: false, isSpecialService: false, isEmergency: false, isValid: true } console.log(validateTunisianNumber("+216 71 234 567")); // { isMobile: false, isLandline: true, isSpecialService: false, isEmergency: false, isValid: true } console.log(validateTunisianNumber("190")); // { isMobile: false, isLandline: false, isSpecialService: false, isEmergency: true, isValid: true }This validation function handles all Tunisian number types and strips common formatting before validation.
function formatTunisianNumber(number, format = 'local') { // Remove all non-digit characters let cleaned = number.replace(/\D/g, ''); // Remove country code if present if (cleaned.startsWith('216')) { cleaned = cleaned.substring(3); } // Handle emergency numbers (3 digits) if (cleaned.length === 3 && /^(190|193|197|198)$/.test(cleaned)) { return cleaned; // Emergency numbers don't need formatting } // Validate length (must be 8 digits for standard numbers) if (cleaned.length !== 8) { throw new Error('Invalid Tunisian phone number length. Expected 8 digits.'); } // Format based on requested output switch (format) { case 'e164': // ITU-T E.164 international format return `+216${cleaned}`; case 'international': // International format with spacing return `+216 ${cleaned.slice(0, 2)} ${cleaned.slice(2, 5)} ${cleaned.slice(5)}`; case 'local': default: // Local format with spacing return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 5)} ${cleaned.slice(5)}`; } } // Example usage console.log(formatTunisianNumber("20123456", "e164")); // Output: +21620123456 console.log(formatTunisianNumber("20123456", "international")); // Output: +216 20 123 456 console.log(formatTunisianNumber("+216 71 234 567", "local")); // Output: 71 234 567 console.log(formatTunisianNumber("190")); // Output: 190 (emergency numbers unchanged)This enhanced formatter supports E.164 format (required for international SMS/voice APIs), international display format, and local Tunisian format.
Advanced Implementation with TypeScript
For type-safe phone number handling, define comprehensive interfaces and enums:
// Enum for number types enum TunisianNumberType { MOBILE = 'mobile', LANDLINE = 'landline', TOLL_FREE = 'toll_free', SHARED_COST = 'shared_cost', PREMIUM_RATE = 'premium_rate', EMERGENCY = 'emergency' } // Enum for operators (note: MNP means prefix doesn't guarantee current operator) enum MobileOperator { TUNISIE_TELECOM = 'Tunisie Telecom', OOREDOO = 'Ooredoo', ORANGE = 'Orange Tunisia', LYCAMOBILE = 'Lycamobile', UNKNOWN = 'Unknown' } // Geographic regions for landlines enum GeographicRegion { TUNIS = 'Greater Tunis', NORTH = 'Northern Tunisia', CENTRAL_EAST = 'Central-East Coast', SOUTH_EAST = 'South-East', CENTRAL_WEST = 'Central-West', NORTH_WEST = 'North-West', SOUTH_WEST = 'South-West' } // Main phone number interface interface TunisianPhoneNumber { countryCode: '+216'; nsn: string; // National Significant Number (8 digits) numberType: TunisianNumberType; allocatedOperator?: MobileOperator; // Prefix-based operator (may differ due to MNP) currentOperator?: MobileOperator; // Actual operator (requires MNP lookup) region?: GeographicRegion; // For landline numbers e164Format: string; // +21620123456 localFormat: string; // 20 123 456 } // Validation result interface interface ValidationResult { valid: boolean; numberType?: TunisianNumberType; errors: string[]; warnings: string[]; } // Example class with validation methods class TunisianPhoneValidator { static validate(number: string): ValidationResult { const cleaned = number.replace(/[\s\-+]/g, '').replace(/^216/, ''); const errors: string[] = []; const warnings: string[] = []; let numberType: TunisianNumberType | undefined; // Emergency numbers if (/^(190|193|197|198)$/.test(cleaned)) { return { valid: true, numberType: TunisianNumberType.EMERGENCY, errors: [], warnings: [] }; } // Check 8-digit requirement if (cleaned.length !== 8) { errors.push(`Invalid length: expected 8 digits, got ${cleaned.length}`); return { valid: false, errors, warnings }; } // Check number type if (/^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$/.test(cleaned)) { numberType = TunisianNumberType.MOBILE; warnings.push('Operator prefix may not reflect current operator due to MNP'); } else if (/^7[1-8]\d{6}$/.test(cleaned)) { numberType = TunisianNumberType.LANDLINE; } else if (/^80\d{6}$/.test(cleaned)) { numberType = TunisianNumberType.TOLL_FREE; } else if (/^81\d{6}$/.test(cleaned)) { numberType = TunisianNumberType.SHARED_COST; warnings.push('Shared cost number - caller and recipient split charges'); } else if (/^88\d{6}$/.test(cleaned)) { numberType = TunisianNumberType.PREMIUM_RATE; warnings.push('Premium rate number - higher charges apply'); } else { errors.push('Number does not match any known Tunisian format'); return { valid: false, errors, warnings }; } return { valid: true, numberType, errors: [], warnings }; } static determineAllocatedOperator(nsn: string): MobileOperator { const prefix = nsn.substring(0, 2); if (/^2[0-9]$/.test(prefix)) return MobileOperator.TUNISIE_TELECOM; if (/^5[0-9]$/.test(prefix)) return MobileOperator.OOREDOO; if (/^9[0-9]$/.test(prefix)) return MobileOperator.ORANGE; if (/^4[0-9]$/.test(prefix)) return MobileOperator.LYCAMOBILE; return MobileOperator.UNKNOWN; } static getRegion(nsn: string): GeographicRegion | undefined { const prefix = nsn.substring(0, 2); const regionMap: Record<string, GeographicRegion> = { '71': GeographicRegion.TUNIS, '72': GeographicRegion.NORTH, '73': GeographicRegion.CENTRAL_EAST, '74': GeographicRegion.SOUTH_EAST, '75': GeographicRegion.CENTRAL_WEST, '76': GeographicRegion.NORTH_WEST, '78': GeographicRegion.SOUTH_WEST }; return regionMap[prefix]; } } // Example usage const result = TunisianPhoneValidator.validate('+216 20 123 456'); console.log(result); // { valid: true, numberType: 'mobile', errors: [], warnings: ['Operator prefix may not reflect...'] }This TypeScript implementation provides type safety, comprehensive validation, and clear error/warning messages for production applications.
Geographic Number Validation with Area Code Check
Enhance validation by verifying both format and area code validity:
// Validate geographic numbers with explicit area code checking function validateGeographicNumber(number) { // Remove whitespace and formatting const cleanNumber = number.replace(/\s+/g, ''); // Extract first 2 digits (area code) const areaCode = cleanNumber.substring(0, 2); // Valid area codes: 71-78 (77 reserved but included) const validAreaCodes = ['71', '72', '73', '74', '75', '76', '77', '78']; const hasValidArea = validAreaCodes.includes(areaCode); // Check overall pattern: 7X followed by 6 digits const matchesPattern = /^7[1-8]\d{6}$/.test(cleanNumber); return hasValidArea && matchesPattern; } // Test cases console.log(validateGeographicNumber('71234567')); // true (Tunis) console.log(validateGeographicNumber('72345678')); // true (Bizerte) console.log(validateGeographicNumber('79123456')); // false (79 not allocated) console.log(validateGeographicNumber('20123456')); // false (mobile number)Validation strategy:
Use this two-stage validation (area code + pattern) to catch edge cases that simple regex might miss.
Handling Mobile Number Portability (MNP)
Implement MNP handling to ensure accurate carrier identification. Tunisia's MNP system, managed by INT (Instance Nationale des Télécommunications), allows subscribers to switch operators while keeping their phone numbers. All four major operators—Tunisie Telecom, Ooredoo, Orange Tunisia, and Lycamobile—participate in the MNP framework established by INT regulations.
MNP Status: Tunisia has implemented mobile number portability as confirmed by ITU DataHub 2024, making it mandatory for all licensed mobile operators.
Critical Concept: Operator prefixes no longer indicate the current carrier. You must query INT's MNP database or operator APIs for real-time carrier information.
MNP System Characteristics:
Impact on Development:
Prefix-based identification fails for ported numbers
20 123 456→ Tunisie Telecom20 123 456→ May be Ooredoo, Orange, or LycamobileReal-time lookup required for carrier-dependent operations
Porting process timeline and constraints
Implementation Best Practices:
// MNP lookup with caching and fallback class MNPLookupService { constructor(apiKey, cacheTimeout = 86400000) { // 24-hour cache this.apiKey = apiKey; this.cache = new Map(); this.cacheTimeout = cacheTimeout; } async getCurrentOperator(nsn) { // Check cache first const cached = this.cache.get(nsn); if (cached && Date.now() - cached.timestamp < this.cacheTimeout) { return cached.operator; } try { // Query INT MNP database or operator API const response = await fetch(`https://mnp-api.example.tn/lookup/${nsn}`, { headers: { 'Authorization': `Bearer ${this.apiKey}` } }); if (!response.ok) throw new Error('MNP lookup failed'); const data = await response.json(); const operator = data.currentOperator; // Cache the result this.cache.set(nsn, { operator, timestamp: Date.now() }); return operator; } catch (error) { console.error('MNP lookup error:', error); // Fallback to prefix-based determination return this.determineOperatorByPrefix(nsn); } } determineOperatorByPrefix(nsn) { const prefix = nsn.substring(0, 2); if (/^2[0-9]$/.test(prefix)) return 'Tunisie Telecom'; if (/^5[0-9]$/.test(prefix)) return 'Ooredoo'; if (/^9[0-9]$/.test(prefix)) return 'Orange Tunisia'; if (/^4[0-9]$/.test(prefix)) return 'Lycamobile'; return 'Unknown'; } clearCache() { this.cache.clear(); } } // Usage example const mnpService = new MNPLookupService('your-api-key'); async function processCall(phoneNumber) { const nsn = phoneNumber.replace(/[\s\-+]/g, '').replace(/^216/, ''); // Get current operator via MNP lookup const currentOperator = await mnpService.getCurrentOperator(nsn); // Route call based on actual operator console.log(`Routing call to ${currentOperator}`); // ... routing logic }Caching Strategy:
Regulatory Compliance:
Per INT regulations, applications must:
Testing MNP Implementation:
INT provides test numbers for MNP validation:
Frequently Asked Questions
What is the country code for Tunisia?
Tunisia's country code is +216. This prefix must be used before the 8-digit National Significant Number (NSN) when dialing from outside Tunisia or storing numbers in international E.164 format. The +216 country code is also used for WhatsApp, international SMS, and all telecommunications services.
Examples:
20 123 456+216 20 123 456+21620123456For WhatsApp and international services, always store phone numbers in E.164 format (
+21620123456) for database consistency and API compatibility.How do I validate a Tunisian mobile phone number?
Tunisian mobile numbers start with 2, 4, 5, or 9 followed by 7 more digits (8 digits total). Validate Tunisian mobile numbers using this regex pattern:
This pattern matches:
Important: Due to Mobile Number Portability (MNP), the prefix no longer indicates the current operator. Use INT's MNP database or operator APIs for accurate carrier identification.
JavaScript validation example:
const mobileRegex = /^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$/; const isValid = mobileRegex.test('20123456'); // trueFor a complete validation tool, see the implementation examples above.
What are Tunisia's area codes for landline numbers?
Tunisia uses 8 geographic area codes for landlines, all starting with
7:All landline numbers follow the format
7X XXX XXX(8 digits total).How does Mobile Number Portability (MNP) work in Tunisia?
Tunisia's MNP system, managed by INT (Instance Nationale des Télécommunications), allows subscribers to switch operators while keeping their phone numbers. The porting process takes 2-7 business days.
Key points:
20(originally Tunisie Telecom) may now be served by any operatorDeveloper impact:
What are Tunisia's emergency numbers?
Tunisia uses standardized 3-digit emergency numbers accessible from any device, even without a SIM card:
Source: U.S. Embassy Tunisia, UK Foreign Travel Advice
Critical requirements:
Validation pattern:
^(190|193|197|198)$What's the difference between toll-free and premium rate numbers in Tunisia?
Tunisia uses three types of special service numbers with distinct billing models:
Toll-Free (80):
80 XXX XXXShared Cost (81):
81 XXX XXXPremium Rate (88):
88 XXX XXXRegulatory requirement: INT mandates that applications display cost warnings before connecting premium rate (88) calls.
How do I convert a Tunisian phone number to E.164 format?
E.164 format is the international standard for phone numbers, required by most SMS APIs, WhatsApp Business API, and telecom systems. Convert Tunisian numbers to E.164 format by removing formatting and adding the +216 country code:
Conversion steps:
20 123 456→2012345621620123456→2012345620123456→+21620123456JavaScript implementation:
function toE164(number) { // Remove formatting let cleaned = number.replace(/[\s\-+]/g, ''); // Remove country code if present if (cleaned.startsWith('216')) { cleaned = cleaned.substring(3); } // Add +216 prefix return `+216${cleaned}`; } console.log(toE164('20 123 456')); // +21620123456 console.log(toE164('+216 71 234 567')); // +21671234567Which operators serve Tunisia's mobile market?
Tunisia's mobile market has 4 licensed operators with market shares as of 2024:
Ooredoo Tunisia:
Tunisie Telecom:
Orange Tunisia:
Lycamobile:
Important: Due to MNP, prefixes no longer guarantee current operator. Always use MNP lookup for accurate carrier identification.
What regex pattern validates all Tunisian phone numbers?
Use this comprehensive regex to validate all Tunisian number types:
// All standard numbers (8 digits) const allNumbersRegex = /^(2[0-9]|4[0-9]|5[0-9]|7[1-8]|80|81|88|9[0-9])\d{6}$/; // Or validate by type: const mobileRegex = /^(2[0-9]|4[0-9]|5[0-9]|9[0-9])\d{6}$/; const landlineRegex = /^7[1-8]\d{6}$/; const specialServiceRegex = /^(80|81|88)\d{6}$/; const emergencyRegex = /^(190|193|197|198)$/;Pattern breakdown:
(2[0-9]|4[0-9]|5[0-9]|9[0-9])+ 6 digits7[1-8]+ 6 digits(80|81|88)+ 6 digits190,193,197, or198Best practice: Validate by number type rather than using a single catch-all pattern. This enables type-specific handling (MNP lookup for mobile, billing warnings for premium rate, etc.).
How often should I update my Tunisia phone number validation rules?
Update your validation logic on these schedules:
Quarterly: Check INT website (intt.tn) for new operator allocations or prefix assignments
Semi-annually: Review operator API documentation for MNP lookup changes
Monitor regulatory updates: INT issued Decision Coll-Reg-2024-08 in July 2024 establishing new numbering plan management rules
As-needed: Immediately when validation failures spike for legitimate numbers
Best practices:
Early warning signs:
Conclusion
Implement reliable Tunisian phone number handling using the validation patterns, MNP strategies, and regulatory compliance guidelines in this guide.
Implementation Priorities:
+216XXXXXXXXfor all database storage and API interactionsRegulatory Compliance Resources:
INT (Instance Nationale des Télécommunications) regulates Tunisia's telecommunications sector. Access official resources:
Implementation Checklist:
Common Implementation Mistakes:
❌ Using prefixes for carrier identification – MNP makes this unreliable; always use MNP lookup ❌ Blocking emergency numbers – Violates INT regulations and creates safety risks ❌ Hard-coding operator prefixes – New allocations or operators render code obsolete ❌ Ignoring special service numbers – Billing disputes arise without proper warnings ❌ Not caching MNP lookups – Performance degrades and API costs increase unnecessarily ❌ Storing in local format – E.164 format required for international integration ❌ Skipping TypeScript – Type safety prevents entire categories of validation errors
Next Steps:
Additional Resources:
Maintain compliance with INT regulations, implement robust MNP handling, and follow E.164 standards to build production-ready phone number validation for Tunisia's telecommunications market.