Lebanon Phone Numbers: +961 Country Code Format & Validation Guide
Comprehensive guide to Lebanon phone number formats (+961): structure, validation, and implementation. Includes landline/mobile prefixes (03, 70, 71, 01, 04-07, 09), regex for national/international formats, and number portability best practices. NSN length: 8 digits.
Format, validate, and handle Lebanon phone numbers in your applications. This guide covers the +961 country code, number structures, carrier identification (Alfa, Touch, Ogero), validation patterns, and security considerations for developers working with Lebanese telecommunications.
Quick Reference
Country: Lebanon
Country Code: +961
International Prefix: 00 (from landlines) / + (from mobiles)
The Telecommunications Regulatory Authority (TRA) manages Lebanon's numbering system, which combines fixed-line and mobile networks. All Lebanese numbers follow the ITU-T E.164 international phone number standard, with a maximum length of 15 digits in international format.
Core Structure
International Format: +961 X XXXXXX (Example: +961 1 234567)
National Format: 0X XXXXXX (Example: 01 234567)
When to Use Each Format:
International format (+961XXXXXXXX): Use for database storage, API integrations, SMS/voice routing, international communications, and cross-border operations. This format ensures global compatibility.
National format (0XXXXXXXX): Use for display to Lebanese users, local marketing materials, and printed materials within Lebanon. Accept this format as user input, but convert to international format before storage.
Handling User Input:
Users enter phone numbers with various formatting characters. Accept and normalize these variations:
JavaScript
// Common input formats to handleconst inputVariations = [
'+961 1 234567', // International with spaces'+961-1-234567', // International with dashes'+961 (1) 234567', // International with parentheses'961 1 234567', // International without +'01 234 567', // National with spaces'01-234-567', // National with dashes'(01) 234567', // National with parentheses'01234567'// National compact
];
functionnormalizeLebanonNumber(input) {
// Remove all non-digit characters except leading +const cleaned = input.replace(/[^\d+]/g, '').replace(/\+(?=.)/g, '');
// Handle various formatsif (cleaned.startsWith('+961') || cleaned.startsWith('961')) {
const digits = cleaned.replace(/^\+?961/, '');
if (digits.length === 8 && /^[1-9]/.test(digits)) {
return`+961${digits}`;
}
} elseif (cleaned.startsWith('0') && cleaned.length === 8) {
return`+961${cleaned.substring(1)}`;
} elseif (cleaned.length === 7 && /^[1-9]/.test(cleaned)) {
return`+961${cleaned}`;
}
returnnull; // Invalid format
}
Best Practice: Store phone numbers in your database using the E.164 international format (+961XXXXXXXX) without spaces or special characters. This ensures consistency and simplifies processing across your application.
Lebanon Area Codes and Mobile Prefixes
Identify Lebanese number types by prefix:
Type
Prefix(es)
Format
Example
Usage Context
Landline (Beirut)
01
01 XXX XXX
01 234 567
Beirut metropolitan area
Landline (Mount Lebanon)
04, 05, 09
0X XXX XXX
04 123 456
Mount Lebanon (Metn, Baabda, Aley, Chouf, Kesrouan, Byblos)
Critical Note: Lebanon has not implemented Mobile Number Portability (MNP) as of 2025. Prefixes reliably indicate the carrier that originally assigned the number, but operators recycle numbers when subscribers switch providers or accounts become inactive.
Security Warning: Touch recycles prepaid numbers after 30 days of inactivity and postpaid numbers after 90 days. Alfa uses a digital system to randomly select and recycle inactive numbers.
Number Recycling Impact on Applications:
Number recycling creates these critical security and UX risks:
Account takeover risk: New subscriber receives SMS verification codes meant for previous owner
Privacy breaches: Personal data, notifications, and sensitive messages sent to wrong person
Two-factor authentication bypass: Attacker obtains recycled number to hijack accounts
Marketing/notification waste: Messages sent to users who never opted in
Support ticket confusion: Multiple users with same historical phone number in your system
Mitigation: Implement phone number re-verification every 60–90 days for security-critical features. Use SMS OTP or phone call verification described in the Troubleshooting section.
How to Validate Lebanon Phone Numbers
Validate Lebanese phone numbers using regex patterns and validation logic. Since Lebanon doesn't have number portability, rely on prefix-based identification to determine the original carrier.
Validation Strategy
Client-side validation:
Provide immediate feedback for formatting errors
Use simple regex to check basic structure
Display helpful error messages with example formats
Allow partial validation as users type
Server-side validation:
Always validate on server (never trust client alone)
Use comprehensive regex with all prefix ranges
Verify the number hasn't been blocklisted or recycled
Log validation failures for monitoring
Implement rate limiting to prevent enumeration attacks
Special Service Numbers:
Lebanon uses special short codes that should not be validated as regular numbers:
Explicitly exclude these short codes from validation, or handle them separately if your application needs to support them.
Regular Expressions for Lebanon Phone Number Validation
Use these regular expressions to validate Lebanese number types:
JavaScript
// International format validation (+961 followed by 8 digits)// Updated to include new 76, 78, 79, 81 mobile ranges (ITU May 2025)const internationalPattern = /^\+961[1-9]\d{6,7}$/;
// National format validation with comprehensive prefix coverage// Includes all prefixes: 01, 03, 04-09, 70, 71, 76, 78, 79, 81const nationalPattern = /^0(?:1\d{6}|[4-9]\d{6}|3(?:0|1[1-5]|[2-5]|6[6-9]|7|8|9)\d{5}|70[0-9]\d{5}|71[0-9]\d{5}|76[0-9]\d{5}|78[7-9]\d{5}|79[1-3]\d{5}|81[0-9]\d{5})$/;
// Landline validation (01, 04-09)const landlinePattern = /^0[1456789]\d{6}$/;
// Mobile validation (Alfa and Touch)// Updated patterns for all mobile prefixesconst mobilePattern = /^0(?:3(?:0|1[1-5]|[2-5]|6[6-9]|7|8|9)|70[0-9]|71[0-9]|76[0-9]|78[7-9]|79[1-3]|81[0-9])\d{5}$/;
// Emergency/special service numbers (3-4 digits)const emergencyPattern = /^(112|125|140|175|1701|1707|1717|119)$/;
// Example usagefunctionisValidLebaneseNumber(number) {
return internationalPattern.test(number) || nationalPattern.test(number);
}
functionisLebaneseMobile(number) {
const cleaned = number.replace(/^\+961/, '0').replace(/\D/g, '');
return mobilePattern.test(cleaned);
}
functionisEmergencyNumber(number) {
const cleaned = number.replace(/\D/g, '');
return emergencyPattern.test(cleaned);
}
// Test cases for validationconst testCases = [
// Valid international mobile
{ input: '+9613123456', expected: true, type: 'Alfa mobile' },
{ input: '+9617623456', expected: true, type: 'Touch mobile' },
{ input: '+9617870000', expected: true, type: 'Touch mobile (new range)' },
// Valid national mobile
{ input: '03123456', expected: true, type: 'Mobile national' },
{ input: '07012345', expected: true, type: 'Mobile 070 range' },
{ input: '07612345', expected: true, type: 'Mobile 076 range' },
// Valid landlines
{ input: '+9611234567', expected: true, type: 'Beirut landline' },
{ input: '01234567', expected: true, type: 'Beirut national' },
{ input: '04123456', expected: true, type: 'Mount Lebanon' },
// Invalid formats
{ input: '+96112345', expected: false, type: 'Too short' },
{ input: '+961012345678', expected: false, type: 'Leading zero in intl' },
{ input: '12345678', expected: false, type: 'Missing prefix' },
{ input: '+961 1 234567', expected: false, type: 'Contains spaces' },
// Emergency numbers
{ input: '112', expected: true, type: 'Police emergency' },
{ input: '140', expected: true, type: 'Ambulance emergency' },
];
// Run tests
testCases.forEach(test => {
const result = isValidLebaneseNumber(test.input) || isEmergencyNumber(test.input);
console.log(`${test.type}: ${result === test.expected ? 'PASS' : 'FAIL'}`);
});
Phone Number Formatting and Sanitization
Maintain consistent formatting to improve data quality and user experience:
JavaScript
functionsanitizePhoneNumber(input) {
return input.replace(/\D/g, ''); // Remove all non-digit characters
}
functionformatLebaneseNumber(number) {
const cleaned = sanitizePhoneNumber(number);
// Handle various input formatsif (cleaned.length === 8 && /^[0-9]/.test(cleaned)) {
// National format: add +961const withoutLeadingZero = cleaned.startsWith('0') ? cleaned.substring(1) : cleaned;
return`+961${withoutLeadingZero}`;
} elseif (cleaned.startsWith('961') && cleaned.length === 11) {
// International without +return`+${cleaned}`;
} elseif (cleaned.startsWith('0') && cleaned.length === 8) {
// National with leading zeroreturn`+961${cleaned.substring(1)}`;
} elseif (!cleaned.startsWith('0') && cleaned.length === 7) {
// 7 digits without prefixreturn`+961${cleaned}`;
}
returnnull; // Invalid format
}
// Error handling for formattingfunctionformatWithErrorHandling(number) {
const formatted = formatLebaneseNumber(number);
if (formatted === null) {
// Log error for monitoringconsole.error('Invalid Lebanese phone number format:', number);
// Return user-friendly errorthrownewError(
'Invalid phone number format. Enter a Lebanese number ' +
'like 01 234567 (national) or +961 1 234567 (international)'
);
}
return formatted;
}
// Complete validation + formatting workflowfunctionprocessUserPhoneInput(rawInput) {
try {
// Step 1: Normalize input (handle spaces, dashes, parentheses)const normalized = normalizeLebanonNumber(rawInput);
if (!normalized) {
return {
success: false,
error: 'Unable to parse phone number. Check the format.',
example: '+961 1 234567 or 01 234567'
};
}
// Step 2: Validate formatif (!isValidLebaneseNumber(normalized) && !isEmergencyNumber(normalized)) {
return {
success: false,
error: 'Invalid Lebanese phone number.',
details: 'Number must start with valid prefix (01-09, 70-79, 81)',
example: '03 123456 (mobile) or 01 234567 (landline)'
};
}
// Step 3: Format for storageconst formatted = formatLebaneseNumber(normalized);
// Step 4: Identify carrier (optional)const carrier = identifyCarrier(formatted);
return {
success: true,
formatted: formatted,
carrier: carrier,
type: isLebaneseMobile(formatted) ? 'mobile' : 'landline'
};
} catch (error) {
return {
success: false,
error: error.message
};
}
}
// Usage exampleconst result = processUserPhoneInput('03-123-456');
if (result.success) {
console.log('Formatted:', result.formatted); // +9613123456console.log('Carrier:', result.carrier); // Alfaconsole.log('Type:', result.type); // mobile
} else {
console.error('Error:', result.error);
}
Lebanon Mobile Carriers: Alfa and Touch
Lebanon operates three state-owned telecommunications providers:
Alfa (MIC1): State-owned mobile operator managed by Orascom Telecom. Uses prefixes 03 (031–035), 070 (1–5), 071 (6–9), 076 (1, 3–5), 079 (1–3), and 081 (2–4). Originally launched in 1994 as the first GSM network in Lebanon.
Touch (MIC2): State-owned mobile operator managed by Zain Group. Uses prefixes 03 (030, 036–039), 070 (0, 6–9), 071 (1–5), 076 (0, 6–9), 078 (7–9), and 081 (6–8). Formerly known as MTC Touch.
Ogero Telecom: Government-owned fixed infrastructure operator handling all landline services (prefixes 01, 04–09). Founded in 1972, Ogero provides backbone infrastructure for all telecom networks, including mobile operators, Data Service Providers (DSPs), and Internet Service Providers (ISPs).
MVNO Status: Lebanon does not have Mobile Virtual Network Operators (MVNOs) or third-party mobile providers. Alfa and Touch provide all mobile services exclusively. No regulatory framework for MVNO licensing exists as of 2025, though this may change with future telecommunications reforms.
Number Portability Status: Lebanon has not implemented Mobile Number Portability (MNP) as of 2025. Users surrender their number when switching between Alfa and Touch. You can reliably use prefix-based carrier identification to determine the original network assignment.
Number Recycling Practices
Understand how operators recycle inactive numbers:
Touch: Recycles prepaid numbers after 30 days of inactivity; recycles postpaid numbers after 90 days
Alfa: Uses a digital system that randomly selects inactive numbers for recycling and re-release
Developer Implication: If your application requires long-term number ownership verification (security, account recovery), implement periodic re-verification. Don't assume permanent number-to-user associations given aggressive recycling timelines.
Common issues when handling Lebanese phone numbers:
Leading Zero Errors
Problem: Missing or incorrect leading zero placement
Solution: Include the leading zero in national format (01 234567) but remove it in international format (+961 1 234567)
Fix: Use the normalization function above to handle both formats
Invalid Prefix Errors
Problem: Your validation rejects a valid Lebanese number
Solution: Verify the prefix exists in the table above. Common mistakes include assuming all 03 numbers belong to Alfa when some (030, 036–039) belong to Touch. Update your regex to include new ranges 76, 78, 79, and 81 added in May 2025.
Debugging tip: Log rejected numbers with prefixes to identify patterns
Carrier Misidentification
Problem: Your system assigns the wrong carrier to a number
Solution: Use the specific prefix ranges listed in the carrier section. Lebanon doesn't have MNP, so prefix-based lookup remains reliable. Reference ITU numbering plan updates.
Example:
JavaScript
functionidentifyCarrier(phoneNumber) {
// Normalize to national format for prefix checkingconst national = phoneNumber.replace(/^\+961/, '0');
// Alfa (MIC1) prefixesconst alfaPrefixes = /^0(?:3[1-5]|70[1-5]|71[6-9]|76[1345]|79[1-3]|81[234])/;
// Touch (MIC2) prefixesconst touchPrefixes = /^0(?:30|3[6-9]|70[0689]|71[1-5]|76[0689]|78[789]|81[678])/;
if (alfaPrefixes.test(national)) {
return'Alfa (MIC1)';
} elseif (touchPrefixes.test(national)) {
return'Touch (MIC2)';
} elseif (/^0[1456789]/.test(national)) {
return'Ogero (Landline)';
}
return'Unknown';
}
Number Recycling Issues
Problem: A phone number that worked for one user now belongs to someone else
Solution: Implement regular verification checks using SMS OTP or phone call verification. Numbers can be reassigned after 30–90 days of inactivity
Verification Methods:
SMS OTP (One-Time Password): Send 6-digit code via SMS, user enters code within 10 minutes
Phone Call Verification: Make automated call with spoken code or callback verification
Silent SMS Verification: Send SMS with delivery receipt (less intrusive but less secure)
Production Debugging Tips:
Structured logging: Log validation failures with input format, detected prefix, and rejection reason
Metrics tracking: Monitor validation failure rates by prefix to catch new number ranges
User feedback loop: Allow users to report "number not accepted" issues
Test with real data: Maintain test suite with real Lebanese numbers (anonymized) covering all prefixes
Best Practices for Lebanon Phone Number Implementation
Handle Lebanese phone numbers effectively:
Input Sanitization
Sanitize user input to remove non-digit characters, spaces, and formatting before validation. Use the normalizeLebanonNumber() function provided above.
Comprehensive Validation
Use regular expressions that cover all valid prefix ranges, including the new 76, 78, 79, and 81 ranges added in May 2025. Don't rely on length checks alone.
Clear Error Messages
Write specific error messages that help users fix issues:
Instead of "Invalid phone number," say "Lebanese phone numbers must start with 0 and have 8 digits (e.g., 01 234567)"
Instead of "Wrong format," say "Enter your number with the country code (+961 1 234567) or without (01 234567)"
Internationalization
Accept and display both national and international formats seamlessly. Convert to E.164 for storage, display in user's preferred format.
Stay Updated
Monitor TRA regulations for changes to the numbering plan or MNP implementation announcements. The most recent update was May 26, 2025. Subscribe to ITU operational bulletins or TRA updates at http://www.tra.gov.lb/.
Account Security
Given rapid number recycling (30–90 days), avoid using phone numbers as sole authentication or account recovery. Implement additional verification methods like email or security keys.
Prefix-Based Routing
Since Lebanon doesn't have MNP, reliably route SMS and calls based on prefix to optimize costs through carrier-specific agreements.
The international country code for Lebanon is +961. When dialing from abroad, dial +961 followed by the 8-digit national number (without the leading 0). To call 01 234567 from outside Lebanon, dial +961 1 234567.
How many digits are in a Lebanon phone number?
Lebanese phone numbers contain 8 digits in national format (NSN length). When including the country code, the full international format is 11 digits: +961 followed by 8 digits.
Does Lebanon have mobile number portability?
No, Lebanon has not implemented Mobile Number Portability (MNP) as of 2025. Users give up their phone number when switching between Alfa and Touch mobile operators. You can reliably identify carriers based on number prefixes.
Some 03 prefixes belong to Alfa while others belong to Touch – check the specific ranges for accurate carrier identification. New mobile prefixes 76, 78, 79, and 81 were added in May 2025 per ITU Communication.
How do I format a Lebanon phone number for international dialing?
Format Lebanese numbers for international use in E.164 format: +961XXXXXXXX (no spaces or special characters). Remove the leading 0 from the national format and prefix with +961. Example: 01 234567 becomes +9611234567.
What is Lebanon's Beirut area code?
Beirut's area code is 01. Within Lebanon, dial 01 followed by 6 digits. From abroad, dial +961 1 followed by 6 digits. The 01 prefix identifies landline numbers in the Beirut metropolitan area.
How long before Lebanon mobile numbers are recycled?
Lebanon mobile operators recycle inactive numbers quickly:
Touch: Recycles prepaid after 30 days, postpaid after 90 days
Alfa: Uses random selection for recycling inactive numbers
This aggressive recycling means phone numbers can be reassigned to new users within 1–3 months of inactivity.
How do I validate a Lebanon phone number in JavaScript?
Use regex patterns to validate Lebanese numbers. For international format:
JavaScript
const pattern = /^\+961[1-9]\d{6,7}$/;
For national format with comprehensive prefix validation, see the full patterns in the validation section above. Include the new 76, 78, 79, and 81 prefixes added in May 2025.
Additional Resources
Explore these official sources for more information:
Implement Lebanese phone number handling in your application:
Copy the validation patterns from the Regular Expressions section into your codebase
Update your database schema to store numbers in E.164 international format (+961XXXXXXXX)
Implement input sanitization to handle various user input formats using the normalizeLebanonNumber() function
Add carrier identification logic using the prefix tables and identifyCarrier() function above
Set up periodic verification for security-critical applications to handle number recycling (every 60–90 days)
Write clear error messages that help users correct formatting issues
Optimize SMS routing by carrier to reduce costs by 10–20%
Monitor and log validation failures to catch new number ranges or patterns
Database Schema Example:
SQL
-- PostgreSQL exampleCREATE TABLE users (
id UUID PRIMARY KEY,
email VARCHAR(255) NOT NULL,
phone VARCHAR(15), -- E.164 format: +961XXXXXXXX
phone_verified BOOLEANDEFAULTFALSE,
phone_verified_at TIMESTAMP,
phone_carrier VARCHAR(20), -- 'Alfa', 'Touch', 'Ogero'
phone_type VARCHAR(10), -- 'mobile', 'landline'
created_at TIMESTAMPDEFAULT NOW(),
updated_at TIMESTAMPDEFAULT NOW()
);
-- Index for fast phone lookupCREATE INDEX idx_users_phone ON users(phone);
-- Migration script to convert existing dataUPDATE users
SET phone ='+961'|| LTRIM(phone, '0')
WHERE phone LIKE'0%'AND LENGTH(phone) =8;
Lebanon hasn't implemented mobile number portability, which means prefix-based carrier identification remains reliable. However, aggressive number recycling practices (30–90 days) may affect long-term number-to-user associations. Stay informed about TRA regulatory changes and monitor ITU operational bulletins for numbering plan updates. The most recent update was May 26, 2025 (Ministerial Decisions No. 172/1, 173/1), adding new mobile number ranges.
Frequently asked questions
The country code for Lebanon is +961. This code is required when dialing Lebanese numbers from outside the country. It precedes the area code and subscriber number.
Store Lebanese phone numbers in the international format (+961XXXXXXXX) without spaces or special characters. This ensures consistency and simplifies processing, regardless of the original input format.
Lebanese phone numbers follow the ITU-T E.164 standard, with a maximum length of 15 digits in the international format (+961 X XXXXXX) and 8 digits in the national format (0X XXXXXX).
Use regular expressions like ^\+961[1-9]\d{6,7}$ for international format and ^0(?:[14-79][\d]{6}|3(?:[\d]{6}|[0-9][\d]{7})|7(?:0|1|6|8|9)[\d]{6}|81[2-8]\d{5})$ for national format for accurate validation and to account for variations in prefixes.
Number portability allows users to change carriers while keeping their number, making prefix-based validation unreliable. A comprehensive approach including regular expressions and carrier lookup APIs is recommended.
The national prefix for calls within Lebanon is 0. It precedes the area code when dialing landlines or mobile numbers domestically.
Remove all non-digit characters from user input using a function or regular expression like replace(/\D/g, '') to ensure data consistency and prevent errors during validation and processing.
The Telecommunications Regulatory Authority (TRA) regulates Lebanon's fixed-line and mobile networks, ensuring compliance with international standards and managing the numbering system.
Due to number portability, relying on prefixes for carrier identification is unreliable. Integrate a real-time carrier lookup API or consider caching lookup results with a reasonable TTL.
Use a carrier lookup API when accurate carrier identification is crucial, such as for routing calls or applying carrier-specific logic. Balance real-time lookups with caching for performance.
Lebanon has two main mobile carriers: Alfa (MIC1) with prefixes 03, 70, 71 and some 07x numbers and Touch (MIC2) using prefixes 76, 78, 79 and some 07x, 03x and 081x numbers.
No, relying solely on prefixes to identify carriers is unreliable due to number portability. Subscribers can switch operators while retaining their existing number.
Lebanese National Significant Numbers (NSNs) have 8 digits. These digits follow the national prefix (0) and the area code when dialing within Lebanon.
Format, validate, and handle Lebanon phone numbers in your applications. This guide covers the +961 country code, number structures, carrier identification (Alfa, Touch, Ogero), validation patterns, and security considerations for developers working with Lebanese telecommunications.
Quick Reference
How to Dial Lebanon Phone Numbers
From abroad to Lebanon: Dial your country's international access code + 961 + local number (without leading 0)
Within Lebanon: Dial the full 8-digit number including area code with leading 0
Emergency Numbers in Lebanon
Source: National News Agency
Understanding Lebanon Phone Number Format
The Telecommunications Regulatory Authority (TRA) manages Lebanon's numbering system, which combines fixed-line and mobile networks. All Lebanese numbers follow the ITU-T E.164 international phone number standard, with a maximum length of 15 digits in international format.
Core Structure
When to Use Each Format:
Handling User Input:
Users enter phone numbers with various formatting characters. Accept and normalize these variations:
// Common input formats to handle const inputVariations = [ '+961 1 234567', // International with spaces '+961-1-234567', // International with dashes '+961 (1) 234567', // International with parentheses '961 1 234567', // International without + '01 234 567', // National with spaces '01-234-567', // National with dashes '(01) 234567', // National with parentheses '01234567' // National compact ]; function normalizeLebanonNumber(input) { // Remove all non-digit characters except leading + const cleaned = input.replace(/[^\d+]/g, '').replace(/\+(?=.)/g, ''); // Handle various formats if (cleaned.startsWith('+961') || cleaned.startsWith('961')) { const digits = cleaned.replace(/^\+?961/, ''); if (digits.length === 8 && /^[1-9]/.test(digits)) { return `+961${digits}`; } } else if (cleaned.startsWith('0') && cleaned.length === 8) { return `+961${cleaned.substring(1)}`; } else if (cleaned.length === 7 && /^[1-9]/.test(cleaned)) { return `+961${cleaned}`; } return null; // Invalid format }Best Practice: Store phone numbers in your database using the E.164 international format (+961XXXXXXXX) without spaces or special characters. This ensures consistency and simplifies processing across your application.
Lebanon Area Codes and Mobile Prefixes
Identify Lebanese number types by prefix:
Critical Note: Lebanon has not implemented Mobile Number Portability (MNP) as of 2025. Prefixes reliably indicate the carrier that originally assigned the number, but operators recycle numbers when subscribers switch providers or accounts become inactive.
Security Warning: Touch recycles prepaid numbers after 30 days of inactivity and postpaid numbers after 90 days. Alfa uses a digital system to randomly select and recycle inactive numbers.
Number Recycling Impact on Applications:
Number recycling creates these critical security and UX risks:
Mitigation: Implement phone number re-verification every 60–90 days for security-critical features. Use SMS OTP or phone call verification described in the Troubleshooting section.
How to Validate Lebanon Phone Numbers
Validate Lebanese phone numbers using regex patterns and validation logic. Since Lebanon doesn't have number portability, rely on prefix-based identification to determine the original carrier.
Validation Strategy
Client-side validation:
Server-side validation:
Special Service Numbers:
Lebanon uses special short codes that should not be validated as regular numbers:
Explicitly exclude these short codes from validation, or handle them separately if your application needs to support them.
Regular Expressions for Lebanon Phone Number Validation
Use these regular expressions to validate Lebanese number types:
// International format validation (+961 followed by 8 digits) // Updated to include new 76, 78, 79, 81 mobile ranges (ITU May 2025) const internationalPattern = /^\+961[1-9]\d{6,7}$/; // National format validation with comprehensive prefix coverage // Includes all prefixes: 01, 03, 04-09, 70, 71, 76, 78, 79, 81 const nationalPattern = /^0(?:1\d{6}|[4-9]\d{6}|3(?:0|1[1-5]|[2-5]|6[6-9]|7|8|9)\d{5}|70[0-9]\d{5}|71[0-9]\d{5}|76[0-9]\d{5}|78[7-9]\d{5}|79[1-3]\d{5}|81[0-9]\d{5})$/; // Landline validation (01, 04-09) const landlinePattern = /^0[1456789]\d{6}$/; // Mobile validation (Alfa and Touch) // Updated patterns for all mobile prefixes const mobilePattern = /^0(?:3(?:0|1[1-5]|[2-5]|6[6-9]|7|8|9)|70[0-9]|71[0-9]|76[0-9]|78[7-9]|79[1-3]|81[0-9])\d{5}$/; // Emergency/special service numbers (3-4 digits) const emergencyPattern = /^(112|125|140|175|1701|1707|1717|119)$/; // Example usage function isValidLebaneseNumber(number) { return internationalPattern.test(number) || nationalPattern.test(number); } function isLebaneseMobile(number) { const cleaned = number.replace(/^\+961/, '0').replace(/\D/g, ''); return mobilePattern.test(cleaned); } function isEmergencyNumber(number) { const cleaned = number.replace(/\D/g, ''); return emergencyPattern.test(cleaned); } // Test cases for validation const testCases = [ // Valid international mobile { input: '+9613123456', expected: true, type: 'Alfa mobile' }, { input: '+9617623456', expected: true, type: 'Touch mobile' }, { input: '+9617870000', expected: true, type: 'Touch mobile (new range)' }, // Valid national mobile { input: '03123456', expected: true, type: 'Mobile national' }, { input: '07012345', expected: true, type: 'Mobile 070 range' }, { input: '07612345', expected: true, type: 'Mobile 076 range' }, // Valid landlines { input: '+9611234567', expected: true, type: 'Beirut landline' }, { input: '01234567', expected: true, type: 'Beirut national' }, { input: '04123456', expected: true, type: 'Mount Lebanon' }, // Invalid formats { input: '+96112345', expected: false, type: 'Too short' }, { input: '+961012345678', expected: false, type: 'Leading zero in intl' }, { input: '12345678', expected: false, type: 'Missing prefix' }, { input: '+961 1 234567', expected: false, type: 'Contains spaces' }, // Emergency numbers { input: '112', expected: true, type: 'Police emergency' }, { input: '140', expected: true, type: 'Ambulance emergency' }, ]; // Run tests testCases.forEach(test => { const result = isValidLebaneseNumber(test.input) || isEmergencyNumber(test.input); console.log(`${test.type}: ${result === test.expected ? 'PASS' : 'FAIL'}`); });Phone Number Formatting and Sanitization
Maintain consistent formatting to improve data quality and user experience:
function sanitizePhoneNumber(input) { return input.replace(/\D/g, ''); // Remove all non-digit characters } function formatLebaneseNumber(number) { const cleaned = sanitizePhoneNumber(number); // Handle various input formats if (cleaned.length === 8 && /^[0-9]/.test(cleaned)) { // National format: add +961 const withoutLeadingZero = cleaned.startsWith('0') ? cleaned.substring(1) : cleaned; return `+961${withoutLeadingZero}`; } else if (cleaned.startsWith('961') && cleaned.length === 11) { // International without + return `+${cleaned}`; } else if (cleaned.startsWith('0') && cleaned.length === 8) { // National with leading zero return `+961${cleaned.substring(1)}`; } else if (!cleaned.startsWith('0') && cleaned.length === 7) { // 7 digits without prefix return `+961${cleaned}`; } return null; // Invalid format } // Error handling for formatting function formatWithErrorHandling(number) { const formatted = formatLebaneseNumber(number); if (formatted === null) { // Log error for monitoring console.error('Invalid Lebanese phone number format:', number); // Return user-friendly error throw new Error( 'Invalid phone number format. Enter a Lebanese number ' + 'like 01 234567 (national) or +961 1 234567 (international)' ); } return formatted; } // Complete validation + formatting workflow function processUserPhoneInput(rawInput) { try { // Step 1: Normalize input (handle spaces, dashes, parentheses) const normalized = normalizeLebanonNumber(rawInput); if (!normalized) { return { success: false, error: 'Unable to parse phone number. Check the format.', example: '+961 1 234567 or 01 234567' }; } // Step 2: Validate format if (!isValidLebaneseNumber(normalized) && !isEmergencyNumber(normalized)) { return { success: false, error: 'Invalid Lebanese phone number.', details: 'Number must start with valid prefix (01-09, 70-79, 81)', example: '03 123456 (mobile) or 01 234567 (landline)' }; } // Step 3: Format for storage const formatted = formatLebaneseNumber(normalized); // Step 4: Identify carrier (optional) const carrier = identifyCarrier(formatted); return { success: true, formatted: formatted, carrier: carrier, type: isLebaneseMobile(formatted) ? 'mobile' : 'landline' }; } catch (error) { return { success: false, error: error.message }; } } // Usage example const result = processUserPhoneInput('03-123-456'); if (result.success) { console.log('Formatted:', result.formatted); // +9613123456 console.log('Carrier:', result.carrier); // Alfa console.log('Type:', result.type); // mobile } else { console.error('Error:', result.error); }Lebanon Mobile Carriers: Alfa and Touch
Lebanon operates three state-owned telecommunications providers:
MVNO Status: Lebanon does not have Mobile Virtual Network Operators (MVNOs) or third-party mobile providers. Alfa and Touch provide all mobile services exclusively. No regulatory framework for MVNO licensing exists as of 2025, though this may change with future telecommunications reforms.
Number Portability Status: Lebanon has not implemented Mobile Number Portability (MNP) as of 2025. Users surrender their number when switching between Alfa and Touch. You can reliably use prefix-based carrier identification to determine the original network assignment.
Number Recycling Practices
Understand how operators recycle inactive numbers:
Developer Implication: If your application requires long-term number ownership verification (security, account recovery), implement periodic re-verification. Don't assume permanent number-to-user associations given aggressive recycling timelines.
Re-verification Implementation:
// Database schema example const userSchema = { id: 'string', phone: 'string', // E.164 format phoneVerified: 'boolean', phoneVerifiedAt: 'timestamp', // Last verification date phoneVerificationCode: 'string', phoneVerificationExpiry: 'timestamp' }; // Check if phone needs re-verification (every 60 days) function needsPhoneReverification(user) { if (!user.phoneVerified) return true; const daysSinceVerification = (Date.now() - user.phoneVerifiedAt) / (1000 * 60 * 60 * 24); return daysSinceVerification > 60; } // Trigger re-verification for security-critical operations async function performSecureOperation(userId) { const user = await getUser(userId); if (needsPhoneReverification(user)) { // Send SMS verification code await sendSMSVerification(user.phone); return { success: false, requiresVerification: true, message: 'Verify your phone number to continue' }; } // Proceed with operation return await executeSecureOperation(user); } // SMS verification code sender async function sendSMSVerification(phoneNumber) { const code = generateSecureCode(6); // 6-digit code const expiry = Date.now() + (10 * 60 * 1000); // 10 minutes // Store code in database await updateUser({ phoneVerificationCode: hashCode(code), phoneVerificationExpiry: expiry, phoneVerified: false }); // Send via SMS provider await smsProvider.send({ to: phoneNumber, message: `Your verification code is ${code}. Valid for 10 minutes.` }); } // Verify code submitted by user async function verifyPhoneCode(userId, submittedCode) { const user = await getUser(userId); // Check expiry if (Date.now() > user.phoneVerificationExpiry) { return { success: false, error: 'Code expired' }; } // Verify code if (hashCode(submittedCode) === user.phoneVerificationCode) { await updateUser({ phoneVerified: true, phoneVerifiedAt: Date.now(), phoneVerificationCode: null }); return { success: true }; } return { success: false, error: 'Invalid code' }; }Troubleshooting Lebanon Phone Number Issues
Common issues when handling Lebanese phone numbers:
Leading Zero Errors
Invalid Prefix Errors
Carrier Misidentification
function identifyCarrier(phoneNumber) { // Normalize to national format for prefix checking const national = phoneNumber.replace(/^\+961/, '0'); // Alfa (MIC1) prefixes const alfaPrefixes = /^0(?:3[1-5]|70[1-5]|71[6-9]|76[1345]|79[1-3]|81[234])/; // Touch (MIC2) prefixes const touchPrefixes = /^0(?:30|3[6-9]|70[0689]|71[1-5]|76[0689]|78[789]|81[678])/; if (alfaPrefixes.test(national)) { return 'Alfa (MIC1)'; } else if (touchPrefixes.test(national)) { return 'Touch (MIC2)'; } else if (/^0[1456789]/.test(national)) { return 'Ogero (Landline)'; } return 'Unknown'; }Number Recycling Issues
Verification Methods:
Production Debugging Tips:
// Production logging example function validateWithLogging(phoneNumber, context = {}) { const result = processUserPhoneInput(phoneNumber); if (!result.success) { logger.warn('Phone validation failed', { input: maskPhoneNumber(phoneNumber), // Mask for privacy error: result.error, context: context, // e.g., userId, page, flow timestamp: new Date().toISOString() }); } return result; } function maskPhoneNumber(phone) { // Mask middle digits: +9613****56 if (phone.length < 8) return phone; return phone.slice(0, -6) + '****' + phone.slice(-2); }Best Practices for Lebanon Phone Number Implementation
Handle Lebanese phone numbers effectively:
Input Sanitization Sanitize user input to remove non-digit characters, spaces, and formatting before validation. Use the
normalizeLebanonNumber()function provided above.Comprehensive Validation Use regular expressions that cover all valid prefix ranges, including the new 76, 78, 79, and 81 ranges added in May 2025. Don't rely on length checks alone.
Clear Error Messages Write specific error messages that help users fix issues:
Internationalization Accept and display both national and international formats seamlessly. Convert to E.164 for storage, display in user's preferred format.
Stay Updated Monitor TRA regulations for changes to the numbering plan or MNP implementation announcements. The most recent update was May 26, 2025. Subscribe to ITU operational bulletins or TRA updates at http://www.tra.gov.lb/.
Account Security Given rapid number recycling (30–90 days), avoid using phone numbers as sole authentication or account recovery. Implement additional verification methods like email or security keys.
Prefix-Based Routing Since Lebanon doesn't have MNP, reliably route SMS and calls based on prefix to optimize costs through carrier-specific agreements.
Routing Implementation:
// Carrier routing configuration const carrierRoutes = { 'Alfa': { prefixes: ['31', '32', '33', '34', '35', '701', '702', '703', '704', '705', '716', '717', '718', '719', '761', '763', '764', '765', '791', '792', '793', '812', '813', '814'], provider: 'alfa-sms-gateway', costPerSMS: 0.045 // USD }, 'Touch': { prefixes: ['30', '36', '37', '38', '39', '700', '706', '707', '708', '709', '711', '712', '713', '714', '715', '760', '766', '767', '768', '769', '787', '788', '789', '816', '817', '818'], provider: 'touch-sms-gateway', costPerSMS: 0.043 // USD } }; function routeSMSByCarrier(phoneNumber, message) { const carrier = identifyCarrier(phoneNumber); const route = carrierRoutes[carrier]; if (!route) { throw new Error(`No route configured for carrier: ${carrier}`); } return { gateway: route.provider, recipient: phoneNumber, message: message, estimatedCost: route.costPerSMS }; } // Bulk SMS optimization async function sendBulkSMS(recipients, message) { // Group by carrier for optimal routing const byCarrier = recipients.reduce((acc, phone) => { const carrier = identifyCarrier(phone); if (!acc[carrier]) acc[carrier] = []; acc[carrier].push(phone); return acc; }, {}); // Send via appropriate gateway const results = await Promise.all( Object.entries(byCarrier).map(([carrier, phones]) => { const route = carrierRoutes[carrier]; return sendViaGateway(route.provider, phones, message); }) ); // Calculate savings const totalCost = results.reduce((sum, r) => sum + r.cost, 0); const singleRouteCost = recipients.length * 0.05; // Generic rate const savings = singleRouteCost - totalCost; console.log(`Sent ${recipients.length} SMS via optimized routing`); console.log(`Cost: $${totalCost.toFixed(2)} (saved $${savings.toFixed(2)})`); return results; }Typical Cost Optimization:
Performance Considerations:
// Regex caching example class LebanonPhoneValidator { constructor() { // Compile patterns once during initialization this.patterns = { international: /^\+961[1-9]\d{6,7}$/, national: /^0(?:1\d{6}|[4-9]\d{6}|3(?:0|1[1-5]|[2-5]|6[6-9]|7|8|9)\d{5}|70[0-9]\d{5}|71[0-9]\d{5}|76[0-9]\d{5}|78[7-9]\d{5}|79[1-3]\d{5}|81[0-9]\d{5})$/, mobile: /^0(?:3(?:0|1[1-5]|[2-5]|6[6-9]|7|8|9)|70[0-9]|71[0-9]|76[0-9]|78[7-9]|79[1-3]|81[0-9])\d{5}$/, emergency: /^(112|125|140|175|1701|1707|1717|119)$/ }; } validate(number) { return this.patterns.international.test(number) || this.patterns.national.test(number); } isMobile(number) { const cleaned = number.replace(/^\+961/, '0').replace(/\D/g, ''); return this.patterns.mobile.test(cleaned); } } // Create singleton instance const validator = new LebanonPhoneValidator(); // Use everywhere in your app validator.validate('+9613123456'); // trueFrequently Asked Questions
What is the country code for Lebanon?
The international country code for Lebanon is +961. When dialing from abroad, dial +961 followed by the 8-digit national number (without the leading 0). To call 01 234567 from outside Lebanon, dial +961 1 234567.
How many digits are in a Lebanon phone number?
Lebanese phone numbers contain 8 digits in national format (NSN length). When including the country code, the full international format is 11 digits: +961 followed by 8 digits.
Does Lebanon have mobile number portability?
No, Lebanon has not implemented Mobile Number Portability (MNP) as of 2025. Users give up their phone number when switching between Alfa and Touch mobile operators. You can reliably identify carriers based on number prefixes.
What are Lebanon mobile number prefixes?
Lebanon mobile numbers use these prefixes:
Some 03 prefixes belong to Alfa while others belong to Touch – check the specific ranges for accurate carrier identification. New mobile prefixes 76, 78, 79, and 81 were added in May 2025 per ITU Communication.
How do I format a Lebanon phone number for international dialing?
Format Lebanese numbers for international use in E.164 format: +961XXXXXXXX (no spaces or special characters). Remove the leading 0 from the national format and prefix with +961. Example: 01 234567 becomes +9611234567.
What is Lebanon's Beirut area code?
Beirut's area code is 01. Within Lebanon, dial 01 followed by 6 digits. From abroad, dial +961 1 followed by 6 digits. The 01 prefix identifies landline numbers in the Beirut metropolitan area.
How long before Lebanon mobile numbers are recycled?
Lebanon mobile operators recycle inactive numbers quickly:
This aggressive recycling means phone numbers can be reassigned to new users within 1–3 months of inactivity.
How do I validate a Lebanon phone number in JavaScript?
Use regex patterns to validate Lebanese numbers. For international format:
const pattern = /^\+961[1-9]\d{6,7}$/;For national format with comprehensive prefix validation, see the full patterns in the validation section above. Include the new 76, 78, 79, and 81 prefixes added in May 2025.
Additional Resources
Explore these official sources for more information:
Phone Validation Libraries:
Next Steps
Implement Lebanese phone number handling in your application:
normalizeLebanonNumber()functionidentifyCarrier()function aboveDatabase Schema Example:
-- PostgreSQL example CREATE TABLE users ( id UUID PRIMARY KEY, email VARCHAR(255) NOT NULL, phone VARCHAR(15), -- E.164 format: +961XXXXXXXX phone_verified BOOLEAN DEFAULT FALSE, phone_verified_at TIMESTAMP, phone_carrier VARCHAR(20), -- 'Alfa', 'Touch', 'Ogero' phone_type VARCHAR(10), -- 'mobile', 'landline' created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW() ); -- Index for fast phone lookup CREATE INDEX idx_users_phone ON users(phone); -- Migration script to convert existing data UPDATE users SET phone = '+961' || LTRIM(phone, '0') WHERE phone LIKE '0%' AND LENGTH(phone) = 8;Lebanon hasn't implemented mobile number portability, which means prefix-based carrier identification remains reliable. However, aggressive number recycling practices (30–90 days) may affect long-term number-to-user associations. Stay informed about TRA regulatory changes and monitor ITU operational bulletins for numbering plan updates. The most recent update was May 26, 2025 (Ministerial Decisions No. 172/1, 173/1), adding new mobile number ranges.