Country Code Checker
UK is not a country code. It feels like it should be — it is the domain, it is what
everyone writes — but ISO 3166-1 assigns GB, and UK appears nowhere in the registry.
That single mismatch is the most common reason a country column gets rejected.
🔒 Your data never leaves your browser.
Five things that all look like a country code
A checker that answers only "valid" or "invalid" flattens five genuinely different situations into two, and they need different work from you:
- Assigned codes — the 247 ordinary country and territory codes. These are what a feed wants.
- Special-purpose codes —
EUis the European Union,UNthe United Nations,EZthe Eurozone. They are in the registry but they are not countries, and a feed expecting a country will reject them. - Private use —
AAandZZmean whatever a particular system decided. Seeing one in an export means an internal placeholder escaped. - Withdrawn codes — 11 of them. Some name a successor
(
BU→MM); some cannot, because the territory split into several. - Not codes at all —
UK. There is nothing to look up.
Why the suggestions are conservative
Where the intent is unmistakable — an alpha-3, a numeric code, a country name, or one of a handful of habits like UK for GB — this tool proposes the right code and says why. Where a territory dissolved into several successors, it does not propose anything, because which successor applies depends on the actual address. A wrong suggestion is worse than none: people apply it and stop checking.
Where the table comes from
The codes are not typed from memory. They are generated from the IANA Language Subtag Registry — whose region subtags are ISO 3166-1 alpha-2, complete with withdrawal dates and replacements — joined to the UN M49 list for alpha-3 and numeric codes. Every current code was then cross-checked against the ICU data built into Node. The generator is committed alongside the data, so the table can be rebuilt and re-verified rather than trusted.
One consequence worth stating plainly: TW is a valid ISO code that every
marketplace uses, but the UN list does not carry it, so its alpha-3 and numeric fields are
empty here rather than filled in from memory.
Every check this tool runs (9 rules)
CC-U01 Not a registered code
The value is not in the registry at all. The famous case is UK: it feels like the obvious code for the United Kingdom, but ISO 3166-1 assigns GB, and UK appears nowhere in the registry. Feeds using it are rejected or silently mis-targeted.
Fix: Use the assigned code. Where the intent is recognisable this tool suggests one.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-D01 Deprecated code with a replacement
The code was withdrawn and the registry names its successor. Old exports and old address databases keep these alive for years after the change.
Fix: Replace it with the successor code the registry names.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-D02 Deprecated with no single successor
The territory was split or dissolved, so no one code replaces it — Netherlands Antilles became several separate entities, Serbia and Montenegro became two countries. Which successor applies depends on the actual address, and no tool can decide that from the code alone.
Fix: Go back to the underlying address and pick the successor it belongs to.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-S01 Special-purpose code, not a country
The code is registered but does not identify an ordinary country — EU is the European Union, UN the United Nations, EZ the Eurozone, and codes such as AC or IC cover territories that are exceptionally reserved rather than assigned. Feeds that expect a country will reject them.
Fix: Use the code of the actual country the address is in.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-P01 Private-use code
AA and ZZ are set aside for private use — they mean whatever a particular system decided they mean. Seeing one in exported data usually means a placeholder or an internal sentinel escaped into the file.
Fix: Find where the placeholder is set and replace it with a real code.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-F01 Wrong form of the code
The value is a recognisable country identifier in the wrong form — a three-letter alpha-3, a numeric code, or a full country name — where the field wants alpha-2.
Fix: Use the two-letter form; the conversion is shown here.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-T01 Assigned by ISO but absent from the UN list
TW is a valid ISO 3166-1 code and every major marketplace uses it, but the UN M49 statistical list does not carry it, so this table has no alpha-3 or numeric code for it from that source. Rather than filling those in from memory, they are left empty.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-A01 Valid country code
The code is an assigned ISO 3166-1 alpha-2 country or area code.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
CC-E01 Not a code at all
Nothing in the value resembles a country code, an alpha-3, a numeric code or a country name this table carries.
Source: Built from the IANA Language Subtag Registry (whose region subtags are ISO 3166-1 alpha-2, with deprecation and replacement data) joined to the UN M49 list for alpha-3 and numeric codes. Both are fetched by scripts/build-country-data.mjs so the table can be regenerated and re-verified rather than trusted.
Carrying 261 current codes and 11 withdrawn ones. This tool checks the code, not the address — it cannot tell you whether the country is the right one for a given customer.