You can be sure that if I find any other strings than ISO 4217 in databases and enums, I'll be disappointed and pissed.
This table is extremely stable.
- The currency codes themselves have never been modified (never been renamed)
- The only modifications are the associations between a currency code, and countries that use that currency (some countries adopted some other currencies, rather than their own)
Data modelling recommendation
Create a dedicated dimension table for currency codes, and use it throughout the codebase.
Use the standard integer currency code number as primary key. Do not use a separate auto-incremented column as primary key (eg - id SERIAL PRIMARY KEY
). This will lead to recognisable uniformity across the codebase, when this currency code number is used as foreign key (over time, you tend to learn the currency codes and their numbers).
Example schema (postgres):
CREATE TABLE CURRENCY_CODES(
number INT PRIMARY KEY,
code VARCHAR(3) NOT NULL
)
Current values as per 1 May 2024
Currency | Code | Number | Country (can change) |
---|---|---|---|
Afghani | AFN | 971 | AFGHANISTAN |
Lek | ALL | 008 | ALBANIA |
Algerian Dinar | DZD | 012 | ALGERIA |
US Dollar | USD | 840 | AMERICAN SAMOA |
Euro | EUR | 978 | ANDORRA |
Kwanza | AOA | 973 | ANGOLA |
East Caribbean Dollar | XCD | 951 | ANGUILLA |
East Caribbean Dollar | XCD | 951 | ANTIGUA AND BARBUDA |
Argentine Peso | ARS | 032 | ARGENTINA |
Armenian Dram | AMD | 051 | ARMENIA |
Aruban Florin | AWG | 533 | ARUBA |
Australian Dollar | AUD | 036 | AUSTRALIA |
Euro | EUR | 978 | AUSTRIA |
Azerbaijanian Manat | AZN | 944 | AZERBAIJAN |
Bahamian Dollar | BSD | 044 | BAHAMAS (THE) |
Bahraini Dinar | BHD | 048 | BAHRAIN |
Taka | BDT | 050 | BANGLADESH |
Barbados Dollar | BBD | 052 | BARBADOS |
Belarussian Ruble | BYN | 933 | BELARUS |
Euro | EUR | 978 | BELGIUM |
Belize Dollar | BZD | 084 | BELIZE |
CFA Franc BCEAO | XOF | 952 | BENIN |
Bermudian Dollar | BMD | 060 | BERMUDA |
Ngultrum | BTN | 064 | BHUTAN |
Indian Rupee | INR | 356 | BHUTAN |
Boliviano | BOB | 068 | BOLIVIA (PLURINATIONAL STATE OF) |
Mvdol | BOV | 984 | BOLIVIA (PLURINATIONAL STATE OF) |
US Dollar | USD | 840 | BONAIRE, SINT EUSTATIUS AND SABA |
Convertible Mark | BAM | 977 | BOSNIA AND HERZEGOVINA |
Pula | BWP | 072 | BOTSWANA |
Norwegian Krone | NOK | 578 | BOUVET ISLAND |
Brazilian Real | BRL | 986 | BRAZIL |
US Dollar | USD | 840 | BRITISH INDIAN OCEAN TERRITORY (THE) |
Brunei Dollar | BND | 096 | BRUNEI DARUSSALAM |
Bulgarian Lev | BGN | 975 | BULGARIA |
CFA Franc BCEAO | XOF | 952 | BURKINA FASO |
Burundi Franc | BIF | 108 | BURUNDI |
Cabo Verde Escudo | CVE | 132 | CABO VERDE |
Riel | KHR | 116 | CAMBODIA |
CFA Franc BEAC | XAF | 950 | CAMEROON |
Canadian Dollar | CAD | 124 | CANADA |
Cayman Islands Dollar | KYD | 136 | CAYMAN ISLANDS (THE) |
CFA Franc BEAC | XAF | 950 | CENTRAL AFRICAN REPUBLIC (THE) |
CFA Franc BEAC | XAF | 950 | CHAD |
Unidad de Fomento | CLF | 990 | CHILE |
Chilean Peso | CLP | 152 | CHILE |
Yuan Renminbi | CNY | 156 | CHINA |
Australian Dollar | AUD | 036 | CHRISTMAS ISLAND |
Australian Dollar | AUD | 036 | COCOS (KEELING) ISLANDS (THE) |
Colombian Peso | COP | 170 | COLOMBIA |
Unidad de Valor Real | COU | 970 | COLOMBIA |
Comoro Franc | KMF | 174 | COMOROS (THE) |
Congolese Franc | CDF | 976 | CONGO (THE DEMOCRATIC REPUBLIC OF THE) |
CFA Franc BEAC | XAF | 950 | CONGO (THE) |
New Zealand Dollar | NZD | 554 | COOK ISLANDS (THE) |
Costa Rican Colon | CRC | 188 | COSTA RICA |
Euro | EUR | 978 | CROATIA |
Peso Convertible | CUC | 931 | CUBA |
Cuban Peso | CUP | 192 | CUBA |
Netherlands Antillean Guilder | ANG | 532 | CURAÇAO |
Euro | EUR | 978 | CYPRUS |
Czech Koruna | CZK | 203 | CZECH REPUBLIC (THE) |
CFA Franc BCEAO | XOF | 952 | CÔTE D'IVOIRE |
Danish Krone | DKK | 208 | DENMARK |
Djibouti Franc | DJF | 262 | DJIBOUTI |
East Caribbean Dollar | XCD | 951 | DOMINICA |
Dominican Peso | DOP | 214 | DOMINICAN REPUBLIC (THE) |
US Dollar | USD | 840 | ECUADOR |
Egyptian Pound | EGP | 818 | EGYPT |
El Salvador Colon | SVC | 222 | EL SALVADOR |
US Dollar | USD | 840 | EL SALVADOR |
CFA Franc BEAC | XAF | 950 | EQUATORIAL GUINEA |
Nakfa | ERN | 232 | ERITREA |
Euro | EUR | 978 | ESTONIA |
Ethiopian Birr | ETB | 230 | ETHIOPIA |
Euro | EUR | 978 | EUROPEAN UNION |
Falkland Islands Pound | FKP | 238 | FALKLAND ISLANDS (THE) [MALVINAS] |
Danish Krone | DKK | 208 | FAROE ISLANDS (THE) |
Fiji Dollar | FJD | 242 | FIJI |
Euro | EUR | 978 | FINLAND |
Euro | EUR | 978 | FRANCE |
Euro | EUR | 978 | FRENCH GUIANA |
CFP Franc | XPF | 953 | FRENCH POLYNESIA |
Euro | EUR | 978 | FRENCH SOUTHERN TERRITORIES (THE) |
CFA Franc BEAC | XAF | 950 | GABON |
Dalasi | GMD | 270 | GAMBIA (THE) |
Lari | GEL | 981 | GEORGIA |
Euro | EUR | 978 | GERMANY |
Ghana Cedi | GHS | 936 | GHANA |
Gibraltar Pound | GIP | 292 | GIBRALTAR |
Euro | EUR | 978 | GREECE |
Danish Krone | DKK | 208 | GREENLAND |
East Caribbean Dollar | XCD | 951 | GRENADA |
Euro | EUR | 978 | GUADELOUPE |
US Dollar | USD | 840 | GUAM |
Quetzal | GTQ | 320 | GUATEMALA |
Pound Sterling | GBP | 826 | GUERNSEY |
Guinea Franc | GNF | 324 | GUINEA |
CFA Franc BCEAO | XOF | 952 | GUINEA-BISSAU |
Guyana Dollar | GYD | 328 | GUYANA |
Gourde | HTG | 332 | HAITI |
US Dollar | USD | 840 | HAITI |
Australian Dollar | AUD | 036 | HEARD ISLAND AND McDONALD ISLANDS |
Euro | EUR | 978 | HOLY SEE (THE) |
Lempira | HNL | 340 | HONDURAS |
Hong Kong Dollar | HKD | 344 | HONG KONG |
Forint | HUF | 348 | HUNGARY |
Iceland Krona | ISK | 352 | ICELAND |
Indian Rupee | INR | 356 | INDIA |
Rupiah | IDR | 360 | INDONESIA |
SDR (Special Drawing Right) | XDR | 960 | INTERNATIONAL MONETARY FUND (IMF) |
Iranian Rial | IRR | 364 | IRAN (ISLAMIC REPUBLIC OF) |
Iraqi Dinar | IQD | 368 | IRAQ |
Euro | EUR | 978 | IRELAND |
Pound Sterling | GBP | 826 | ISLE OF MAN |
New Israeli Sheqel | ILS | 376 | ISRAEL |
Euro | EUR | 978 | ITALY |
Jamaican Dollar | JMD | 388 | JAMAICA |
Yen | JPY | 392 | JAPAN |
Pound Sterling | GBP | 826 | JERSEY |
Jordanian Dinar | JOD | 400 | JORDAN |
Tenge | KZT | 398 | KAZAKHSTAN |
Kenyan Shilling | KES | 404 | KENYA |
Australian Dollar | AUD | 036 | KIRIBATI |
North Korean Won | KPW | 408 | KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF) |
Won | KRW | 410 | KOREA (THE REPUBLIC OF) |
Kuwaiti Dinar | KWD | 414 | KUWAIT |
Som | KGS | 417 | KYRGYZSTAN |
Kip | LAK | 418 | LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE) |
Euro | EUR | 978 | LATVIA |
Lebanese Pound | LBP | 422 | LEBANON |
Loti | LSL | 426 | LESOTHO |
Rand | ZAR | 710 | LESOTHO |
Liberian Dollar | LRD | 430 | LIBERIA |
Libyan Dinar | LYD | 434 | LIBYA |
Swiss Franc | CHF | 756 | LIECHTENSTEIN |
Euro | EUR | 978 | LITHUANIA |
Euro | EUR | 978 | LUXEMBOURG |
Pataca | MOP | 446 | MACAO |
Malagasy Ariary | MGA | 969 | MADAGASCAR |
Kwacha | MWK | 454 | MALAWI |
Malaysian Ringgit | MYR | 458 | MALAYSIA |
Rufiyaa | MVR | 462 | MALDIVES |
CFA Franc BCEAO | XOF | 952 | MALI |
Euro | EUR | 978 | MALTA |
US Dollar | USD | 840 | MARSHALL ISLANDS (THE) |
Euro | EUR | 978 | MARTINIQUE |
Ouguiya | MRU | 929 | MAURITANIA |
Mauritius Rupee | MUR | 480 | MAURITIUS |
Euro | EUR | 978 | MAYOTTE |
ADB Unit of Account | XUA | 965 | MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP |
Mexican Peso | MXN | 484 | MEXICO |
Mexican Unidad de Inversion (UDI) | MXV | 979 | MEXICO |
US Dollar | USD | 840 | MICRONESIA (FEDERATED STATES OF) |
Moldovan Leu | MDL | 498 | MOLDOVA (THE REPUBLIC OF) |
Euro | EUR | 978 | MONACO |
Tugrik | MNT | 496 | MONGOLIA |
Euro | EUR | 978 | MONTENEGRO |
East Caribbean Dollar | XCD | 951 | MONTSERRAT |
Moroccan Dirham | MAD | 504 | MOROCCO |
Mozambique Metical | MZN | 943 | MOZAMBIQUE |
Kyat | MMK | 104 | MYANMAR |
Namibia Dollar | NAD | 516 | NAMIBIA |
Rand | ZAR | 710 | NAMIBIA |
Australian Dollar | AUD | 036 | NAURU |
Nepalese Rupee | NPR | 524 | NEPAL |
Euro | EUR | 978 | NETHERLANDS (THE) |
CFP Franc | XPF | 953 | NEW CALEDONIA |
New Zealand Dollar | NZD | 554 | NEW ZEALAND |
Cordoba Oro | NIO | 558 | NICARAGUA |
CFA Franc BCEAO | XOF | 952 | NIGER (THE) |
Naira | NGN | 566 | NIGERIA |
New Zealand Dollar | NZD | 554 | NIUE |
Australian Dollar | AUD | 036 | NORFOLK ISLAND |
US Dollar | USD | 840 | NORTHERN MARIANA ISLANDS (THE) |
Norwegian Krone | NOK | 578 | NORWAY |
Rial Omani | OMR | 512 | OMAN |
Pakistan Rupee | PKR | 586 | PAKISTAN |
US Dollar | USD | 840 | PALAU |
No universal currency | PALESTINE, STATE OF | ||
Balboa | PAB | 590 | PANAMA |
US Dollar | USD | 840 | PANAMA |
Kina | PGK | 598 | PAPUA NEW GUINEA |
Guarani | PYG | 600 | PARAGUAY |
Nuevo Sol | PEN | 604 | PERU |
Philippine Peso | PHP | 608 | PHILIPPINES (THE) |
New Zealand Dollar | NZD | 554 | PITCAIRN |
Zloty | PLN | 985 | POLAND |
Euro | EUR | 978 | PORTUGAL |
US Dollar | USD | 840 | PUERTO RICO |
Qatari Rial | QAR | 634 | QATAR |
Denar | MKD | 807 | REPUBLIC OF NORTH MACEDONIA |
Romanian Leu | RON | 946 | ROMANIA |
Russian Ruble | RUB | 643 | RUSSIAN FEDERATION (THE) |
Rwanda Franc | RWF | 646 | RWANDA |
Euro | EUR | 978 | RÉUNION |
Euro | EUR | 978 | SAINT BARTHÉLEMY |
Saint Helena Pound | SHP | 654 | SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA |
East Caribbean Dollar | XCD | 951 | SAINT KITTS AND NEVIS |
East Caribbean Dollar | XCD | 951 | SAINT LUCIA |
Euro | EUR | 978 | SAINT MARTIN (FRENCH PART) |
Euro | EUR | 978 | SAINT PIERRE AND MIQUELON |
East Caribbean Dollar | XCD | 951 | SAINT VINCENT AND THE GRENADINES |
Tala | WST | 882 | SAMOA |
Euro | EUR | 978 | SAN MARINO |
Dobra | STN | 930 | SAO TOME AND PRINCIPE |
Saudi Riyal | SAR | 682 | SAUDI ARABIA |
CFA Franc BCEAO | XOF | 952 | SENEGAL |
Serbian Dinar | RSD | 941 | SERBIA |
Seychelles Rupee | SCR | 690 | SEYCHELLES |
Leone | SLE | 925 | SIERRA LEONE |
Singapore Dollar | SGD | 702 | SINGAPORE |
Netherlands Antillean Guilder | ANG | 532 | SINT MAARTEN (DUTCH PART) |
Sucre | XSU | 994 | SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS "SUCRE" |
Euro | EUR | 978 | SLOVAKIA |
Euro | EUR | 978 | SLOVENIA |
Solomon Islands Dollar | SBD | 090 | SOLOMON ISLANDS |
Somali Shilling | SOS | 706 | SOMALIA |
Rand | ZAR | 710 | SOUTH AFRICA |
No universal currency | SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS | ||
South Sudanese Pound | SSP | 728 | SOUTH SUDAN |
Euro | EUR | 978 | SPAIN |
Sri Lanka Rupee | LKR | 144 | SRI LANKA |
Sudanese Pound | SDG | 938 | SUDAN (THE) |
Surinam Dollar | SRD | 968 | SURINAME |
Norwegian Krone | NOK | 578 | SVALBARD AND JAN MAYEN |
Lilangeni | SZL | 748 | SWAZILAND |
Swedish Krona | SEK | 752 | SWEDEN |
WIR Euro | CHE | 947 | SWITZERLAND |
Swiss Franc | CHF | 756 | SWITZERLAND |
WIR Franc | CHW | 948 | SWITZERLAND |
Syrian Pound | SYP | 760 | SYRIAN ARAB REPUBLIC |
New Taiwan Dollar | TWD | 901 | TAIWAN (PROVINCE OF CHINA) |
Somoni | TJS | 972 | TAJIKISTAN |
Tanzanian Shilling | TZS | 834 | TANZANIA, UNITED REPUBLIC OF |
Baht | THB | 764 | THAILAND |
US Dollar | USD | 840 | TIMOR-LESTE |
CFA Franc BCEAO | XOF | 952 | TOGO |
New Zealand Dollar | NZD | 554 | TOKELAU |
Pa’anga | TOP | 776 | TONGA |
Trinidad and Tobago Dollar | TTD | 780 | TRINIDAD AND TOBAGO |
Tunisian Dinar | TND | 788 | TUNISIA |
Turkish Lira | TRY | 949 | TURKEY |
Turkmenistan New Manat | TMT | 934 | TURKMENISTAN |
US Dollar | USD | 840 | TURKS AND CAICOS ISLANDS (THE) |
Australian Dollar | AUD | 036 | TUVALU |
Uganda Shilling | UGX | 800 | UGANDA |
Hryvnia | UAH | 980 | UKRAINE |
UAE Dirham | AED | 784 | UNITED ARAB EMIRATES (THE) |
Pound Sterling | GBP | 826 | UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE) |
US Dollar | USD | 840 | UNITED STATES MINOR OUTLYING ISLANDS (THE) |
US Dollar | USD | 840 | UNITED STATES OF AMERICA (THE) |
US Dollar (Next day) | USN | 997 | UNITED STATES OF AMERICA (THE) |
Uruguay Peso en Unidades Indexadas (URUIURUI) | UYI | 940 | URUGUAY |
Peso Uruguayo | UYU | 858 | URUGUAY |
Uzbekistan Sum | UZS | 860 | UZBEKISTAN |
Vatu | VUV | 548 | VANUATU |
Bolivar | VEF | 937 | VENEZUELA (BOLIVARIAN REPUBLIC OF) |
Bolivar | VED | 926 | VENEZUELA (BOLIVARIAN REPUBLIC OF) |
Dong | VND | 704 | VIET NAM |
US Dollar | USD | 840 | VIRGIN ISLANDS (BRITISH) |
US Dollar | USD | 840 | VIRGIN ISLANDS (U.S.) |
CFP Franc | XPF | 953 | WALLIS AND FUTUNA |
Moroccan Dirham | MAD | 504 | WESTERN SAHARA |
Yemeni Rial | YER | 886 | YEMEN |
Zambian Kwacha | ZMW | 967 | ZAMBIA |
Zimbabwe Dollar | ZWL | 932 | ZIMBABWE |
Euro | EUR | 978 | ÅLAND ISLANDS |