How Postal Codes Work Around the World

3 min read · Maintained by Leslie · Content updated

Originally published 2026-08-11. This content update is separate from the historical dates on underlying reference records.

Postal code structure

A postal code is a short string used by a national postal service to sort and route mail. Formats vary by country: the United States uses five-digit ZIP codes, Canada uses letter-number pairs, and the United Kingdom uses alphanumeric postcode districts.

The structure usually encodes a region, district, and delivery area rather than a single address.

Formats and examples

Country-level reference pages show the format description, a validation pattern, and example codes from a public dataset. For example, the US format is NNNNN[-NNNN] and Canada is A0A 0A0.

Examples illustrate format and are not proof that a code is assigned to a particular address. A pattern match is not an address or delivery check.

What this reference covers

The current version publishes country-level postal formats rather than a full worldwide database of individual postcodes.

Each postal page links back to its country page so the format can be understood alongside the rest of the country reference.

Worked example: a shipping form rejects the postcode

First check that the country selector matches the shipping address. A Canadian code entered while the country is set to United States may fail because the form expects digits. Compare the original code with the recipient’s address and the postal operator’s preferred spacing and capitalization.

Do not delete letters to satisfy a numeric-only field or replace the code with random digits. If a form cannot accept a confirmed destination format, ask the sender or carrier to resolve it. Preserve the original address while troubleshooting; changing the format cannot correct an address that belongs to a different delivery area.

Separate format, assignment and delivery checks

A regular expression can catch a shape error, but it cannot establish that a code is assigned, belongs to the street or accepts a carrier’s service. Use the destination postal operator’s address finder for assignment checks, then confirm the full address with the recipient. The carrier must separately confirm service availability for the item being shipped.

Store postal codes as text so leading zeros and letters survive exports. A0A 0A0 describes Canadian character positions; it is not a promise that that literal string is assigned. In a US ZIP+4 code, the four-digit extension is not a house or apartment number. Missing format data here means verification is needed, not that the correct replacement is zero or that the destination is unsupported.

Preserve the leading zero during a spreadsheet handoff

Use 02108 as a five-character input to test an import. A numeric column can turn it into 2108. Inspect the exported text as delivered to the receiving system. If a zero vanished, return to the original address and export the postcode column as text.

Do not prepend zero to every short entry. The missing character might be elsewhere, or the address might use another country’s format. A value that matches the five-digit US pattern still needs to be checked against the full address with the postal operator.

Sources and further checks

Use the listed sources and worked references to check the examples.