1001Ferramentas
๐Ÿ“ฑValidators

BR Mobile Number Validator (ANATEL)

Validate Brazilian mobile (ANATEL post-2016): DDD + 9 + 8 digits = 11 total.

Brazilian mobile numbering: Anatel, the PNB and the mandatory 9th digit

In Brazil, the format of telephone numbers is regulated by Anatel (Agencia Nacional de Telecomunicacoes) through the Plano de Numeracao Brasileiro (PNB), a public document that defines the structure, length and allocation rules for every line in the country. The rules that govern a mobile number today are very specific: a Brazilian celular has 11 digits in the national format and 13 digits in the international E.164 format.

The 11-digit national form breaks down as DD 9XXXX XXXX: two digits for the area code (DDD), then the mandatory 9 as the leading digit of any mobile subscriber number, then 8 more digits. The international form simply prepends the country code +55, producing +55 DD 9XXXX XXXX โ€” exactly the format expected by WhatsApp Business API, Twilio, Zenvia, Infobip and every other global SMS gateway.

This validator inspects the structural rules: country code (optional), DDD (must be a valid Brazilian area code), mandatory 9 as the first subscriber digit, and total length. It does not call out to Anatel, does not contact any carrier and does not check whether the line is active.

Why every Brazilian mobile starts with 9: the 2014 migration

Until 2012, Brazilian mobiles had 8 subscriber digits โ€” the same length as fixed lines. As mobile penetration exploded, Anatel published Resolution 553/2010, scheduling the addition of an extra 9 to the front of every cell number. The rollout happened region by region from 2012 through July 2016, with Sao Paulo (DDD 11) leading in 2012 and the last northern DDDs migrating in 2016.

A trailing consequence is that any number coming through an old database without the 9 is, by definition, obsolete and unreachable. CRMs and marketing platforms still find these legacy formats โ€” typically in customer records imported before 2014 โ€” and modern validators must either reject them outright or trigger an automated upgrade routine that prepends the 9 when the rest of the number looks consistent.

A second consequence: mobile and fixed numbers are now visually distinguishable. After the DDD, a mobile always begins with 9, while a fixed line begins with 2, 3, 4 or 5. This rule replaces the old "first digit 6, 7, 8 or 9 = mobile" heuristic that pre-2014 software relied on.

DDD allocation: how the 67 area codes map to Brazilian regions

Brazil has 67 active DDDs, distributed across the 27 federation units. The first digit of the DDD roughly identifies the macro-region: 1x for Sao Paulo, 2x and 3x for Rio de Janeiro/Espirito Santo/Minas Gerais, 4x for Parana, 5x for Rio Grande do Sul, 6x for Centro-Oeste, 7x for Bahia and parts of the Northeast, 8x for the Northeast coast and 9x for the North.

  • 11 Sao Paulo (capital and Grande SP)
  • 21 Rio de Janeiro (capital, Niteroi, Grande Rio)
  • 31 Belo Horizonte
  • 41 Curitiba
  • 47 Joinville/Blumenau
  • 51 Porto Alegre
  • 61 Brasilia DF
  • 62 Goiania
  • 71 Salvador
  • 81 Recife
  • 85 Fortaleza
  • 91 Belem
  • 92 Manaus

A complete validator must reject DDDs that do not exist in Anatel's published list (for example 20, 23, 25, 26, 29, 30, 36, 39, 40, 50, 52 and several others are not allocated). The most common mistake in homegrown regexes is accepting any two-digit prefix.

Carriers, MVNOs, eSIM and portability

The Brazilian mobile market is dominated by three nationwide carriers โ€” Vivo (Telefonica), Claro (America Movil) and TIM โ€” plus regional players like Algar Telecom in the Triangulo Mineiro and a growing list of MVNOs (Mobile Virtual Network Operators) such as Surf Telecom, Lyca Mobile and Veek that ride on top of the big three.

Portabilidade numerica has been a constitutional right since 2008 (Resolution 460), administered by ABR Telecom. A subscriber can change carriers without changing the number; the DDD is preserved as long as the address stays in the same area. This breaks a critical assumption many CRMs still encode: you cannot infer the current carrier from the number alone โ€” you must query the ABR Telecom HLR lookup or a paid bureau like Twilio Lookup.

The arrival of eSIM in Brazil (commercially since 2020) adds another layer: a single line can switch between physical SIM and virtual eSIM without changing the subscriber number, and dual-SIM phones can carry two Brazilian DDDs simultaneously.

Practical use cases and front-end masking

A pure-format Brazilian mobile validator is the gatekeeper for several common flows:

  • Lead capture forms: filter out fake numbers before they hit the marketing automation.
  • SMS and WhatsApp gateways: Twilio, Zenvia and Infobip charge per send attempt; rejecting malformed numbers locally saves money.
  • 2FA and account recovery: invalid mobiles block users from receiving codes.
  • Brazilian e-commerce checkouts: Magazine Luiza, Magalu, Mercado Livre and Americanas masks expect (11) 99999-9999 and reject anything that does not match the PNB.
  • Compliance with Lei do Marco Civil da Internet (12.965/2014): reliable contact data is part of the duty of care.

The de facto front-end mask in Brazil is (DD) 9XXXX-XXXX. Many sites also accept the international form +55 (DD) 9XXXX-XXXX to support travelers and ex-pats; this validator handles both shapes.

FAQ

Is the leading 9 truly mandatory for mobiles?

Yes, since the 2014 migration. Any mobile number without it is, by definition, obsolete and unreachable. Fixed lines never start with 9 after the DDD.

If I port my number to another carrier, does the DDD change?

No. Number portability preserves both the DDD and the subscriber digits. Only the carrier behind the line changes.

Do I need to include +55 to be valid?

For domestic Brazilian forms, no. For international gateways and WhatsApp Business API, yes โ€” the E.164 standard requires the country code.

Does this validator confirm the line is active?

No. It only verifies the structure (DDD, leading 9, length). Active/inactive status requires an HLR lookup against ABR Telecom or a paid bureau.

Can I distinguish prepaid from postpaid by the number?

No. There is no structural rule that separates prepaid from postpaid lines โ€” both share the same numbering plan. The distinction lives in the carrier's billing system.

Related Tools