Frequently Asked Questions
The country code for Tanzania is +255. This code is required when dialing Tanzanian phone numbers from outside the country. It uniquely identifies Tanzania in the global telecommunications network, ensuring calls are routed correctly.
Tanzanian phone numbers follow the E.164 international standard, with a maximum length of fifteen digits, and include a country code +255. Domestically, the national prefix is 0, while for international format the national prefix is omitted when dialing internationally. The structure looks like this: +255 [National Significant Number (9 digits)]
The article provides a JavaScript function using regular expressions to validate different Tanzanian number formats, including geographic, mobile, toll-free, premium, shared-cost, and emergency numbers. For production, using a dedicated phone number validation library or API is recommended for more comprehensive validation.
The article includes a Python function using regular expressions to validate various Tanzanian number types, including geographic, mobile, toll-free, premium, shared cost, and emergency numbers. For enhanced validation, consider using a specialized library or API, especially when dealing with user-supplied data.
Tanzania uses various number ranges for different services: geographic (landlines), mobile, toll-free, premium, shared cost, and emergency numbers. Each type has a specific format, detailed in the article's table, which is crucial for accurate validation and routing.
MNP allows subscribers to switch operators while keeping their number, which affects validation and routing. Systems handling Tanzanian numbers should use operator-agnostic validation and real-time operator lookup to ensure accurate call routing, as prefixes may not reflect the current operator.
The TCRA regulates the Tanzanian communications sector. They manage Mobile Number Portability (MNP) and set technical specifications for number handling. Developers should consult TCRA resources for compliance and accurate operator information.
As of June 2023, the major operators are Vodacom, Airtel, and Tigo (merged with Zantel). While prefixes typically indicate the original assigned operator, MNP means the actual operator might differ. Number portability databases or APIs are crucial for accurate routing.
Always consider MNP. Relying only on number prefixes to identify the operator can lead to incorrect routing. Real-time operator lookup through a database or API is crucial for accurate routing in applications handling Tanzanian phone numbers.
Key laws include the Tanzania Communication Regulatory Authority Act of 2003, the Electronic and Postal Communications Act (EPOCA) of 2010 (revised in 2022), and the Universal Communications Service Access Act, 2006. These laws regulate aspects like licensing and operations.
Due to Mobile Number Portability (MNP), prefixes don't reliably indicate the current operator. It's essential to integrate with a number portability database or API or utilize services provided by the Tanzania Communications Regulatory Authority (TCRA) to determine the actual operator for a given number.
Key technical considerations include scalability for the growing market, compliance with TCRA regulations, supporting both legacy and modern telecommunication protocols, and implementing real-time number status verification to manage changes like porting.
While prefixes traditionally indicate the original assigned operator, Mobile Number Portability (MNP) allows users to switch operators while retaining their number. Therefore, relying solely on prefixes isn't reliable for determining the current operator.
Tanzania Phone Numbers: Format, Area Code & Validation Guide
Introduction
Build applications that handle Tanzanian phone numbers correctly. This comprehensive guide covers Tanzania country code +255, phone number structure, validation regex patterns, and best practices for integrating with Tanzania's telecommunications system – from basic E.164 formats to Mobile Number Portability (MNP) and TCRA regulatory requirements.
Who should read this: Developers building messaging platforms, authentication systems, contact management tools, or any application that stores or validates Tanzanian phone numbers.
Common use cases: SMS delivery, two-factor authentication, CRM systems, payment gateways, and telecom integrations.
Quick Reference
Key identifiers for Tanzanian phone numbers:
Sources: ITU-T E.164 Standard; ITU Tanzania Numbering Plan
Understand the Tanzanian Phone Numbering System
Tanzania's telephone numbering system follows the international E.164 standard (ITU-T Recommendation E.164). This standard ensures your application can handle phone numbers consistently across borders.
Why E.164 matters for developers: E.164 defines a maximum of 15 digits and requires a structured format (country code + national number). This standardization enables your database schemas to be predictable, your APIs to validate input reliably, and your routing logic to work correctly across international networks. Store all numbers in E.164 format (+255XXXXXXXXX) to avoid formatting inconsistencies and enable seamless international dialing.
Each Tanzanian phone number consists of:
Source: Telephone numbers in Tanzania - Wikipedia
Number Formats in Detail
Tanzania uses different number ranges for specific services. Validate against the correct pattern based on your application's needs:
2[2-8]XXXXXXX
6[125-9]XXXXXXX
,7[13-9]XXXXXXX
80[08]XXXXXX
90XXXXXXX
840XXXXXX
,86[01]XXXXXX
11[12]
,999
Geographic area codes: The second digit (2-8) in landline numbers indicates the region. For example, 22 is Dar es Salaam, 25 is Mwanza, and 27 is Arusha.
Sources: ITU Tanzania Numbering Plan; Emergency Numbers Tanzania
Implement Tanzania Phone Number Validation
Validate Tanzanian phone numbers to ensure data integrity and prevent routing errors. These examples demonstrate regex validation patterns and core validation logic with error handling:
JavaScript Validation for Tanzania Numbers
Production recommendations: Use libraries like google-libphonenumber or awesome-phonenumber for comprehensive validation. These libraries handle international prefixes, formatting variations, and edge cases automatically. For high-volume applications, cache validation results and consider rate limiting to prevent abuse.
Python Validation for Tanzania Numbers
Production recommendations: Use phonenumbers library for robust validation:
Handle null/empty inputs explicitly to prevent runtime errors:
Tanzania Mobile Network Operators
Know the major mobile operators and their number prefixes for accurate routing and integration planning:
Operator integration: Contact operator business development teams for API access. Most operators provide SMS gateway APIs, USSD integration, and mobile money APIs. Check each operator's developer portal for documentation and onboarding requirements.
Sources: List of mobile network operators in Tanzania - Wikipedia; Tanzania Mobile Operators 2025
As of June 2023, Vodacom, Airtel, and Tigo (now merged with Zantel) dominate the market, collectively holding the lion's share of mobile subscriptions. This information is valuable when considering market reach and potential integration with specific operators. These number ranges represent the original assigned operator. Due to Mobile Number Portability (MNP), a number might be used by a different operator than the one originally assigned.
Important clarification: The Tigo-Zantel merger completed in 2019. In April 2022, the combined entity (MIC Tanzania Limited) was sold to a consortium led by AXIAN Telecom and Mr. Rostam Azizi for $100 million, bringing approximately 14 million mobile customers to AXIAN Telecom.
Source: Tanzania Mobile Operators Complete Merger - TanzaniaInvest
Understand Mobile Number Portability (MNP)
MNP allows subscribers to switch operators while keeping their existing phone numbers. Number prefixes no longer reliably indicate the current operator.
Implement MNP Lookup
Integrate with a number portability database to determine the current operator:
Option 1: TCRA Central Reference Database
Option 2: Third-party APIs
Implementation approach:
Cache lookup results with appropriate TTL (e.g., 24 hours) to reduce API calls and improve performance.
MNP Implementation: Mobile number portability in Tanzania officially started on March 1 (implementation occurred around 2016–2023, with various sources citing different dates). Over 40 million Tanzanians can switch networks without changing their mobile numbers, and this service is offered free of charge.
Porting timeline: Number porting typically completes within 3-5 business days. During porting, numbers may experience temporary service interruptions. Build retry logic into your application to handle transient failures during the porting window.
Source: TCRA Mobile Number Portability
Plan Your Technical Architecture
Design systems that handle Tanzania's growing mobile market:
Scalability requirements:
Compliance checklist:
Technology stack recommendations:
Cloud deployment patterns:
Implement health checks for external dependencies (MNP databases, operator APIs) with automatic failover to cached data.
Navigate the Legal and Regulatory Framework
Comply with Tanzania's telecommunications legal framework:
Key legislation:
Compliance requirements for developers:
Application licensing:
Penalties for violations:
Contact TCRA (info@tcra.go.tz) for licensing inquiries or visit https://tcra.go.tz/services for guidance.
Conclusion
You now have the knowledge to handle Tanzanian phone numbers correctly in your applications. Validate numbers properly, implement MNP lookup for accurate routing, and comply with TCRA regulations. Monitor TCRA announcements for regulatory updates that may affect your implementation.
Frequently Asked Questions About Tanzania Phone Numbers
What is Tanzania country code for phone numbers?
+255 is the Tanzania country code. When dialing internationally, use +255 followed by the 9-digit national number (omit the leading 0 used for domestic dialing). Tanzania follows the ITU-T E.164 international standard. Example: A mobile number displayed domestically as 0712 345 678 becomes +255 712 345 678 internationally.
How to validate Tanzania phone numbers with regex?
Use the regex pattern
^(?:6[125-9]|7[13-9])\\d{7}$
for validating 9-digit mobile numbers in national format (without the 0 prefix). Mobile numbers start with prefixes 61, 62, 65, 67, 68, 69, 71, 73, 74, 75, 76, 77, or 78. For international format validation, use^(\\+255|255)?(?:6[125-9]|7[13-9])\\d{7}$
. Remove spaces and special characters before validation.What mobile network operators serve Tanzania?
Tanzania has 7 major operators: Vodacom Tanzania (prefixes 74, 75, 76), Airtel Tanzania (68, 69, 78), Tigo (65, 67, 71), Halotel (61, 62), Zantel (77), Smile (66), and TTCL (73). Vodacom leads with comprehensive 4G/5G coverage. Tigo merged with Zantel in 2019; the combined entity was sold to AXIAN Telecom in 2022. Mobile Number Portability allows subscribers to keep numbers when switching operators.
What are the emergency numbers in Tanzania?
111, 112, and 999 (Police, Fire, Ambulance). Critical limitation: 112 doesn't work consistently outside Dar es Salaam, and there are no government-provided ambulance services. Include warnings about these limitations in your application and provide alternative emergency contacts for rural areas.
What is the format for Tanzania geographic (landline) phone numbers?
2[2-8]\\d{7}
– starts with "2" followed by a digit from 2-8, then 7 additional digits (9 digits total). Examples: 222 123 456 or 288 765 432. International format: +255 followed by the 9-digit number (+255 222 123 456). Regex:^2[2-8]\\d{7}$
. These are fixed-line numbers associated with specific geographic areas.How does Mobile Number Portability (MNP) work in Tanzania?
MNP allows subscribers to switch operators while keeping their numbers. Implementation began March 1 (2016-2023), is free, and covers 40+ million Tanzanians. TCRA manages MNP. Critical for developers: Don't rely on number prefixes to identify the current operator. Implement real-time operator lookup using a number portability database or API for correct routing.
What is the National Significant Number (NSN) length for Tanzania?
9 digits for all phone types (mobile, landline, toll-free, premium). International format follows E.164 with max 15 digits: +255 (country code) + 9-digit NSN. Domestic dialing adds "0" prefix (10 digits total).
What are Tanzania toll-free and premium number formats?
Toll-free:
80[08]\\d{6}
(e.g., 800 123 456) – free for callers, recipient pays. Premium:90\\d{7}
(e.g., 901 234 567) – higher rates for special content/services. Shared cost:840\\d{6}
or86[01]\\d{6}
– costs split between caller and recipient. All use 9-digit NSN.What regulatory authority governs Tanzania telecommunications?
Tanzania Communications Regulatory Authority (TCRA) governs all telecommunications. TCRA manages the National Numbering Plan, oversees MNP, enforces technical specifications, and ensures consumer protection. Legal framework: TCRA Act (2003), Electronic and Postal Communications Act (EPOCA 2010, revised 2022), and Universal Communications Service Access Act (2006). Comply with TCRA regulations when building telecom applications.
How to format Tanzania phone numbers correctly?
Use 3-3-3 grouping with spaces for display: Mobile: 712 345 678, Landline: 222 123 456, Toll-free: 800 123 456, International: +255 712 345 678. Domestic display includes "0" prefix: 0712 345 678. Store numbers in E.164 format (+255712345678) in databases for consistency and international compatibility.