Country Code ISO 3166 Alpha-2 Validator
Validate whether a normalized two-letter value is a currently assigned ISO 3166-1 alpha-2 country code. Reserved and user-assigned letter pairs are not accepted.
Description
Validate normalized values against the 249 assigned ISO 3166-1 alpha-2 country codes rather than letter-count formatting alone.
Validate whether a normalized two-letter value is a currently assigned ISO 3166-1 alpha-2 country code. Reserved and user-assigned letter pairs are not accepted.
When to use Country Code ISO 3166 Alpha-2 Validator
- Validate normalized values against the 249 assigned ISO 3166-1 alpha-2 country codes rather than letter-count formatting alone.
- Apply the same explicit rule consistently during ingest, quality control, reporting, or preservation planning.
- Expose records that need human review without silently rewriting the source data.
How the calculation works
Reserved, exceptional, and user-assigned pairs such as EU or XK are not the same as officially assigned ISO 3166-1 country codes.1, 2
valid = uppercase(trim(code)) ∈ assigned ISO 3166-1 alpha-2 set Interpreting the result
Reserved, exceptional, and user-assigned pairs such as EU or XK are not the same as officially assigned ISO 3166-1 country codes.
Limitations and assumptions
- ISO assignments can change; applications needing live maintenance notices should refresh their code table from the ISO 3166 Maintenance Agency.
- Preserve the original value and record the rule version when using this result in an archival workflow.
References
-
ISO 3166 Country Codes — International Organization for Standardization
-
Digital preservation — Wikipedia contributors
Similar or alternative tools
- Language Code ISO 639-2 Three-Letter Validator
Validate assigned ISO 639-2 bibliographic and terminology codes, plus the qaa–qtz locally reserved range, and return the lowercase normalized form.
- ISO 8601 Date Interval Format Validator
Validate a practical ISO 8601 interval subset of the form start/end. It checks Gregorian calendar dates (including leap years), clock and UTC-offset ranges, reduced-precision dates, and non-mixed calendar or week durations; it does not compare endpoint chronology.
- Format Obsolescence Watchlist Risk Score Rater
Rate preservation format obsolescence risk on a capped 0-100 scale (two points per year since release plus twenty for proprietary formats, twenty-five when emulation is required and fifteen when validation tooling is lacking) with low, moderate, high and critical tiers.