ISO 4217 is the international standard for currency codes. Using these codes ensures your application handles currencies unambiguously across different countries and systems.
Code Structure
ISO currency codes are three letters. The first two usually match the ISO 3166 country code (US, GB, JP), and the third is typically the currency initial (D for dollar, P for pound, Y for yen). Thus USD, GBP, JPY. Exceptions exist for historical reasons.
Major World Currencies
The most traded currencies are USD (US Dollar), EUR (Euro), JPY (Japanese Yen), GBP (British Pound), and CNY (Chinese Yuan). These "majors" have the tightest spreads and most liquidity. EUR/USD is the single most traded currency pair globally.
Special Codes
XAU represents gold, XAG silver, and XPT platinum (X indicates non-country codes). XOF and XAF are used by multiple African nations sharing currencies. XXX indicates no currency, and XTS is for testing. Cryptocurrencies are not part of ISO 4217.
Minor Units
ISO 4217 also defines minor units (decimal places). Most currencies use 2 (cents, pence). JPY, KRW use 0. BHD, KWD, OMR use 3. This is critical for correctly storing and displaying amounts.