DEV Community

Kadir Çakmak
Kadir Çakmak

Posted on

I made a currency converter that runs in a single HTML file

I wanted a simple currency converter I could open anywhere — no install, no login, no API key. So I built one.
It's a single index.html file. Download it, open it in your browser, done. Or just use it online.
Live: https://seyyidkadir.github.io/fx-currency-converter
GitHub: https://github.com/SeyyidKadir/fx-currency-converter
What it does
140+ currencies — from major ones to obscure ones like the Bhutanese Ngultrum or Eritrean Nakfa
26 languages — auto-detects your browser language. Arabic and Persian get RTL layout automatically.
3 swappable data sources:
Frankfurter — most stable, ~33 major currencies
ExchangeRate-API — 160+ currencies, free
Fawaz Currency API — 170+ currencies, CDN-hosted, zero CORS issues
Smart caching — rates are fetched once per session per base currency. No redundant requests.
Manual refresh button with last-updated timestamp
Font size control — 3 levels (A / A+ / A++) for accessibility
Mobile-first — works on any screen size
If an API fails, it tells you which one and suggests switching — something like "This API may not support this currency. Frankfurter is usually the most reliable."
Why 3 APIs?
Each one has trade-offs:
Frankfurter is rock solid but only covers ~33 currencies
ExchangeRate-API covers more but occasionally has CORS issues
Fawaz is CDN-hosted so CORS is never a problem, and it covers the most currencies
Letting the user pick made more sense than silently failing.
No Yahoo Finance
Early on I tried Yahoo Finance via JSONP to avoid CORS. It worked for a while, then Yahoo started blocking it too. Replaced it with Fawaz API — much cleaner.
Tech
Zero dependencies. No frameworks, no build step, no npm. Just HTML, CSS, and vanilla JS. The whole thing is one file you can read in 10 minutes.
Feedback welcome — especially if something breaks in your language or region. 🙂

Top comments (0)