Skip to content

GEC Country Codes Explained (Why ch Means China)

Published

If you paste an old CIA World Factbook link like /library/publications/the-world-factbook/geos/ch.html into a browser expecting Switzerland, two things go wrong. First, every Factbook URL on cia.gov now returns a 302 redirect to a generic farewell page, so you get no country content at all (the Factbook shut down on February 4, 2026). Second, even if you recover the page from an archive, ch never meant Switzerland. In Factbook URLs, ch is China.

Those two-letter codes are GEC codes, and anyone who works with legacy Factbook citations (librarians repairing references, developers parsing old URLs, editors fixing Wikipedia links) needs to know how they work.

What GEC codes are

GEC stands for Geopolitical Entities and Codes. It is the successor to FIPS 10-4, a United States federal data standard for country and region codes that long predates the web. The CIA built the Factbook’s URL scheme on these codes and kept them for a quarter century: every country page from the mid-1990s until the January 2021 redesign was keyed by a two-letter GEC code.

The codes appear lowercase in page URLs (geos/in.html for India) and uppercase in attachment filenames (IN-summary.pdf, IN-flag.gif). Even the modern 2021-2026 site, which switched country pages to name slugs like /the-world-factbook/countries/india/, quietly kept GEC codes in its static flag assets (/the-world-factbook/static/flags/IN-flag.jpg, verified in captures as late as 2024).

The Factbook published its own cross-reference as Appendix D. That page last returned a live 200 response on December 22, 2020, so today you reach it through the Wayback Machine or through mirrors of the final pre-redesign edition.

Why GEC and ISO 3166 disagree

ISO 3166 is the code standard nearly everything else on the internet uses: ch is Switzerland, de is Germany, jp is Japan. GEC was assigned independently, by a different agency, from different name forms, on a different timeline, and the two systems were never reconciled. Some GEC codes were derived from names ISO abbreviated differently (ja for Japan, sw for Sweden), some were assigned to avoid internal collisions (iz for Iraq), and some simply landed on letters that ISO later gave to another country.

The result is a codespace where a naive ISO interpretation misroutes many of the most-cited countries in the world. A URL parser that assumes ISO semantics will send China traffic to Switzerland and Germany traffic to Gambia.

The famous traps

These are the codes most likely to burn you, verified against the archived 2020 Appendix D and against the page titles of the archived country pages themselves:

GEC codeFactbook meaningSame letters in ISO 3166
chChinaSwitzerland (CHE)
gmGermanyGambia (GMB)
jaJapanunassigned (Japan is JP)
krKiribatiSouth Korea (KOR)
knKorea, NorthSaint Kitts and Nevis
ksKorea, Southunassigned
swSwedenunassigned (Sweden is SE)
szSwitzerlandEswatini
izIraqunassigned
rsRussiaSerbia
eeEuropean UnionEstonia (EST)
zaZambiaSouth Africa
mnMonacoMongolia
niNigeriaNicaragua
bmBurma (Myanmar)Bermuda
agAlgeriaAntigua and Barbuda

The Korea cluster deserves special care. In GEC, kr is Kiribati, while the Koreas are kn (North) and ks (South). A parser that maps kr to South Korea, which is exactly what ISO training tells it to do, gets three countries wrong at once.

The ee case is a different kind of trap: it is not even a country. The Factbook used ee for its European Union entry, while ISO uses EE for Estonia (whose GEC code is en).

Dissolved entities and special codes

A complete decoder also needs codes for entities that no longer exist, because citations from those years still circulate:

  • yi is Serbia and Montenegro, used from 2003 to 2006 while that state union existed.
  • nt is the Netherlands Antilles, which appeared until the entity’s dissolution in 2010.

There are also non-country codes. xx means World. The ocean pages had their own codes: zh (Atlantic), zn (Pacific), xo (Indian), xq (Arctic), and oo (Southern). The scattered US Pacific territories (Baker, Howland, Jarvis, Johnston, Kingman, Midway, Palmyra) were consolidated under um in the final 2020 appendix, though several carried their own codes in earlier editions, such as wq for Wake Island and bq for Navassa Island. A robust resolver accepts the old individual codes and maps them all to the same destination.

One more wrinkle for developers: the modern site’s code reference page at /the-world-factbook/references/country-data-codes/ listed GENC three-letter codes (like AFG) alongside ISO 3166, not the legacy two-letter GEC codes. If you scraped that page hoping to decode geos/ URLs, you scraped the wrong table.

Where the codes appear in old URLs

GEC codes key four generations of Factbook URLs:

  • 1996-2000, odci.gov and early cia.gov: /cia/publications/factbook/{gec}.html
  • 2000-2007: /cia/publications/factbook/geos/{gec}.html
  • 2007-2021, the era most academic citations use: /library/publications/the-world-factbook/geos/{gec}.html
  • 2021-2026: country pages moved to name slugs, but flag assets stayed GEC-keyed

So a citation reading geos/gm.html in a 2015 paper is Germany, not Gambia, and geos/kr.html in a 2012 bibliography is Kiribati, not South Korea.

How our resolver handles this

Our citation fixer exists because the CIA’s redirect throws away all of this context. Paste any historical Factbook URL, from any era, and the resolver:

  1. Detects the URL era from its pattern, including the odci.gov host alias and Wayback-wrapped URLs.
  2. Looks up the country key in the correct system: the full GEC table (all 269 codes, including dissolved entities like yi and nt, ocean codes, and the historic US territory codes) for pre-2021 URLs, and the name-slug table for 2021-2026 URLs. It never falls back to ISO guessing.
  3. Returns the matching live country page on this site, plus an era-appropriate Wayback Machine deep link so you can see the page as it existed when it was cited.

That last step matters for verification: the Wayback Machine holds roughly 29,000 snapshots of the Factbook, so nearly every cited page still exists somewhere, provided you resolve the code correctly first.

Practical tips

  • Never run a Factbook geos/ URL through an ISO 3166 lookup. Use a GEC table, or use our resolver, which does it for you.
  • When repairing a bibliography, keep the original URL in the citation and add the archived or current location. Factbook content is US government work in the public domain (17 U.S.C. 105), so mirroring and quoting it is unrestricted.
  • For current figures rather than the frozen January 22, 2026 data, our country pages carry live-refreshed values with source and year labels. For background on what happened to the Factbook and which archives hold what, see our archive explainer.

More guides