Skip to content

Currency data

Source

currencies.yml is generated from two XML lists published by SIX, the ISO 4217 maintenance agency:

  • List One: current currencies and funds, one entry per entity that uses each currency.
  • List Three: historic denominations, with their withdrawal dates.

The file's header records the publication date of each list. The current file uses List One published 2026-09-17 and List Three published 2026-01-01.

Entities with no universal currency, such as Antarctica, have no code and are left out.

Updating

Do not edit currencies.yml by hand. From the module root:

php scripts/update-currencies.php
git diff --stat currencies.yml

The script downloads both lists from SIX and rewrites the file. To use files you have already downloaded:

php scripts/update-currencies.php path/to/list-one.xml path/to/list-three.xml

Then:

  1. Read the diff. Note codes that were added, codes that moved from List One to List Three, and renamed currencies.
  2. Run the tests (ddev phpunit or vendor/bin/phpunit in a Drupal codebase). Some test fixtures name specific currencies.
  3. Commit the file with the added and withdrawn codes in the commit message, and list them in the changelog.

ISO publishes amendments several times a year. Check for a new list before each release.

What an update changes on a site

  • A newly withdrawn currency drops out of the widget for new values. Items that store it keep it, and it stays valid.
  • A new currency appears in the widget.
  • A renamed currency changes its label in the widget and formatter. Stored codes do not change.
  • No code is ever removed from the file, since List Three keeps withdrawn codes, so stored values keep validating.

The decoded list is cached under a key that includes the file's modification time, so a deployed file is read without a cache rebuild. Pages already in the render cache keep their old labels until it is cleared.

Changes since 2.0.0

The 2.0.0 file was a 2018 copy of the datasets/currency-codes CSV. Regenerating it from the 2026 lists:

Change Codes
Added SLE (Sierra Leone), VED (Venezuela, BolĂ­var Soberano), XAD (Arab Accounting Dinar), XCG (Caribbean Guilder), ZWG (Zimbabwe Gold)
Withdrawn ANG (2025-03), BGN (2026-01), CUC (2021-06), HRK (2023-01), SLL (2023-12), ZWL (2024-09)
Euro adopted Croatia (2023), Bulgaria (2026)