ISO 4217 currency code reference
ISO 4217 standardizes the codes used to identify currencies in pricing, accounting and payment systems. Each currency has a three-letter alphabetic code (USD, EUR), a three-digit numeric code (840, 978), and a defined minor unit — the number of decimal places it normally uses. This reference is searchable by code, name or country and highlights the often-missed minor-unit count.
How it works
The alphabetic code is constructed from the country’s ISO 3166-1 alpha-2 code plus a letter for the currency: GB + P = GBP (Pound), US + D = USD (Dollar). Supranational and special codes start with X (EUR is an exception that predates the rule; XAU is gold, XDR is the IMF Special Drawing Right).
The crucial field for software is the minor unit (exponent):
amount_major = amount_minor / 10^minor
USD, minor 2: 150 cents -> 1.50
JPY, minor 0: 150 yen -> 150
BHD, minor 3: 150 fils -> 0.150
Always store money as an integer count of minor units together with the currency code, then scale only when displaying. This prevents floating-point drift and makes the minor-unit table the single source of truth for formatting.
Currencies with non-standard minor units
Most currencies use two decimal places, but a significant number do not. Getting this wrong causes payment API errors, accounting mismatches, and overcharges:
Zero-decimal currencies (minor unit = 0)
| Code | Currency | Country |
|---|---|---|
| JPY | Japanese yen | Japan |
| KRW | South Korean won | South Korea |
| VND | Vietnamese dong | Vietnam |
| UGX | Ugandan shilling | Uganda |
| IDR | Indonesian rupiah | Indonesia |
| PYG | Paraguayan guaraní | Paraguay |
| RWF | Rwandan franc | Rwanda |
For these, the “amount in minor units” is the same as the face value. ¥2000 is sent to a payment API as 2000, not 200000.
Three-decimal currencies (minor unit = 3)
| Code | Currency | Country |
|---|---|---|
| BHD | Bahraini dinar | Bahrain |
| KWD | Kuwaiti dinar | Kuwait |
| JOD | Jordanian dinar | Jordan |
| OMR | Omani rial | Oman |
| TND | Tunisian dinar | Tunisia |
For these, 1.000 BHD is 1000 in minor units, and 1.5 BHD is 1500.
Tips and notes
- Never assume two decimals. Hardcoding
* 100correctly handles USD, EUR, GBP, and most currencies — but silently corrupts JPY, KRW, BHD, KWD, and others. Always look up the exponent. - The numeric code is useful in systems that cannot carry Latin letters (financial messaging formats, legacy EDI systems) and usually mirrors the country’s ISO 3166-1 numeric code.
- Codes beginning with
Xare not ordinary national currencies — they are supranational (EURis an exception), commodity (XAU= gold,XAG= silver), or testing codes. Filter them out if you only want spendable money. - Pair every monetary amount with its currency code in storage. An integer amount without a currency code is meaningless — you cannot know if
1000means ten dollars, one thousand yen, or one dinar.