Skip to content

Postcode

published · September 10, 2026 · updated · September 23, 2026

A postcode is the code a postal service uses to sort mail to a delivery area, called a ZIP code in the United States, an Eircode in Ireland, a PIN in India and a CEP in Brazil.

A postcode is the code a postal service uses to sort mail to a delivery area. It is called a ZIP code in the United States, an Eircode in Ireland, a PIN in India and a CEP in Brazil; postal_code_type answers zip, eircode or pin where the country's format names one of those, and postal_code everywhere else that has postcodes.

What Spaw answers

Four fields, and they answer different questions. postal_code_valid says whether the code matches the country's own pattern. postcode_status says what the national postcode directory records — live, terminated, or null where no directory is installed or the code lies outside the one that is. locality_matches_postcode says whether the town given agrees with the directory. Two reasons come out of this: invalid_postal_code for a code that cannot be one, and postcode_not_found for a well-formed code that a complete directory does not list.

A terminated postcode is a real address whose code was retired, not a typo. It scores +30 and is reported rather than refused.

Coverage, stated plainly

Great Britain's directory is the ONS Postcode Directory, and the places a British postcode is written with come from Ordnance Survey's Open Names; Northern Ireland's BT postcodes are left out of it, because their reuse needs a Land & Property Services licence. So the directory is not consulted for them: an address with a BT postcode is answered with postcode_status null, as though no directory were installed for it — no town or county comparison, no centroid — and never with postcode_not_found. Null there means the code was not evaluated, not that it is wrong. BFPO numbers and the BF1 and BX codes, which the release does not carry, are answered the same way. About a hundred other countries have a directory from the GeoNames postal-code file. Only a complete directory — Great Britain's, and the GeoNames copies that reach the operator's published total, fifteen countries on 16 September 2026 — can call a code postcode_not_found; a partial one confirms the codes it holds and denies none. The postcode directory entry explains the difference, and the address verification guide names the complete countries.

A postcode is also not an address. A UK code is a routing unit covering a group of delivery points — one side of a street, one office block — and turning a code into the addresses inside it needs a licence this service does not hold; the postcode endpoint answers the streets of the code's district instead, never the addresses. Only a country with neither a licensed list nor an open street listing answers 501 ADDRESS_LIST_UNAVAILABLE.

Related

markdown version: /glossary/postcode.md

Verify addresses the same way

The Spaw API runs every check described here on each lookup, with an SMTP handshake that never sends mail. 10 free lookups a month, no card required.

Get your API key

More glossary

  • Area-code overlay

    An area-code overlay is a new area code added over the same area as an existing one, instead of splitting it, so neighbours can hold different codes and local calls need ten digits.

  • Calling window

    A calling window is the span of local hours a sender contacts people in. Spaw answers in_call_window from the number's time zones: clock arithmetic, not compliance advice.

  • Fictional number

    A fictional number sits in a range kept out of service for films, TV and other fiction: 555-0100 to 555-0199 in North America, and ranges Ofcom, ARCEP, ACMA and ComReg reserve elsewhere.

  • International (exit) prefix

    An international prefix is what is dialled to leave a country before the calling code: 00 in most of the world, 011 in North America. Spaw reads it and suggests a fix in did_you_mean.

  • International network number

    An international network number sits under a calling code the ITU gives a global service rather than a country, such as +870, +881, +882 or +883, so its country is null.

  • Live carrier check (HLR lookup)

    A live carrier check asks the mobile networks, at the moment of the lookup, whether a number is in service, which network serves it and whether it is roaming. On Spaw it is not enabled.

  • Number pooling (thousands-blocks)

    Number pooling splits a North American central office code into ten blocks of a thousand numbers, each assigned to a carrier separately, so one code can hold several carriers' numbers.

  • Number portability

    Number portability lets a subscriber keep a phone number when changing carrier. The number's block stays listed under the carrier it was issued to, so block data names the original holder.