Brazil CEP validator

How the CEP format works

Format
8 digits, written with a hyphen as 00000-000
Example
01310100

Things to watch for

  • Format-only check — does not confirm the CEP actually exists
  • 8 digits total; normally written with a hyphen after the first 5 digits (00000-000)
Regex for CEP
^[0-9]{8}$

A Brazilian CEP (Código de Endereçamento Postal) is the address code Correios uses to route mail, always 8 digits and conventionally written with a hyphen after the fifth digit — for example 01310-100 in São Paulo. Because a CEP narrows all the way down to a specific street, and sometimes to a single large building or company, a wrong digit anywhere in the string can misroute a delivery far more precisely than a coarser 4- or 5-digit postcode would. Anyone validating a shipping address, a checkout form, or a spreadsheet of Brazilian customer records needs the CEP fully correct in length before it’s trusted.

A common data-entry slip is typing only 5 digits (mistaking a CEP for a shorter international postcode) or leaving the hyphen in place after stripping spaces — both of which a length-and-shape check catches immediately.

How this validator works

This tool checks that the input is exactly 8 digits once any hyphen or space is stripped, entirely in your browser — nothing is sent to a server, and there’s no signup.

What a pass doesn’t tell you

A CEP carries no check digit, so confirming it’s 8 digits long is the most a client-side tool can do — not that Correios has assigned it to a real street or building. Confirming that requires the Correios CEP lookup.

Scope: this page and tool cover CEP format validation only — not address lookup, street-level matching, or delivery confirmation.

CEP FAQ

What does CEP stand for and what do its 8 digits encode?

CEP stands for Código de Endereçamento Postal. Correios structures it hierarchically: the first digit marks a broad national region, the next narrows it to a sub-region, and the following digits step down through sector, subsector, and delivery area — with the final three digits (after the hyphen) sometimes dedicated to one specific street, large building, or company that receives high mail volume.

Do I need to type the hyphen in a CEP?

No — this validator accepts the CEP with or without the hyphen (e.g. '01310100' or '01310-100'). The hyphen is a formatting convention that separates the first 5 digits from the last 3; the underlying code is always 8 digits.

Does a correctly formatted CEP mean it actually exists?

No. This tool only confirms the string is 8 digits — it doesn't check the code against Correios' actual address database. Confirming a CEP is real, and seeing the street or company it maps to, requires the Correios CEP lookup.

← More CEP validators