Inverse Exchange Rate: How to Calculate EUR to USD from USD to EUR

6 min read

Inverse Exchange Rate: How to Calculate EUR to USD from USD to EUR

If you know the EUR to USD rate, you can get USD to EUR by dividing 1 by it. That is the inverse exchange rate: inverse = 1 / rate. If 1 EUR buys 1.0842 USD, then 1 USD buys 1 / 1.0842 = 0.922339 EUR (rounded to six places).

The math fits on one line. The bugs come from what you do next: rounding the inverse and reusing it, inverting a rate that is not a mid-market rate, or mixing observations taken at different times. This article covers the formula, the precision trap, and a simple rule for when to invert and when to ask for the reverse pair directly.

How the inverse exchange rate works

An exchange rate says how much of the quote currency one unit of the base currency is worth. EUR/USD = 1.0842 means 1 EUR = 1.0842 USD. Swap the direction and the rate becomes its reciprocal:

PairRate (example)How it is derived
EUR/USD1.0842given
USD/EUR0.9223391 / 1.0842
USD/JPY155.20given
JPY/USD0.00644331 / 155.20

All numbers here are examples, not current market rates.

Two things follow from the table:

  • Strong-to-weak pairs invert to small numbers. JPY/USD is about 0.0064, so a handful of significant digits matters far more than a fixed count of decimals.
  • Inverting twice returns the original. 1 / (1 / r) = r in exact math. In a computer with rounding, it does not.

You can also convert an amount without ever computing the inverse. To turn 500 USD into EUR using EUR/USD = 1.0842, divide: 500 / 1.0842 = 461.17 EUR. Dividing by the rate and multiplying by the inverse are the same operation in theory. In practice, dividing once by the original rate is safer.

The rounding trap: why round trips lose money

Suppose you store the inverse rounded to four decimals, because that is how rates are often displayed: 0.9223.

Convert 1,000,000 EUR to USD at 1.0842 and you get 1,084,200 USD. Convert it back with the rounded inverse:

1,084,200 × 0.9223 = 999,957.66 EUR

You are 42.34 EUR short on a round trip that should be exact. With six decimals (0.922339) the result is about 999,999.94, closer but still not exact. The inverse of 1.0842 is a non-terminating decimal, so no finite rounding can be perfect.

The rules that avoid this:

  1. Keep the original rate and divide by it. Do not store a rounded inverse and multiply by it.
  2. If you must compute an inverse, use a decimal type with plenty of precision, such as 20 to 28 significant digits, and round only the final money amount.
  3. Never use binary floats for rates or amounts. See currency conversion rounding without floating-point errors for why, and currency decimal places for how many digits each currency needs at display time.
  4. Display rounding is not storage rounding. Show 0.9223 in a UI if you like, but keep the full-precision value behind it.

Python example: invert safely with Decimal

GetRatesAPI returns rates and amounts as JSON strings, so you can parse them straight into exact decimals. This example fetches EUR/USD, then converts USD to EUR by dividing once instead of multiplying by a rounded inverse.

import os
from decimal import Decimal, getcontext, ROUND_HALF_EVEN

import requests

getcontext().prec = 28  # plenty of headroom for inverses

API = "https://api.getratesapi.com"
HEADERS = {"Authorization": f"ApiKey {os.environ['GETRATESAPI_KEY']}"}

resp = requests.get(f"{API}/v1/rates/EUR/USD", headers=HEADERS, timeout=10)
resp.raise_for_status()
data = resp.json()

rate = Decimal(data["rate"])        # EUR/USD, e.g. Decimal("1.0842")
usd_amount = Decimal("500.00")

# Divide once by the original rate; do not multiply by a rounded inverse.
eur_amount = (usd_amount / rate).quantize(Decimal("0.01"), rounding=ROUND_HALF_EVEN)

print(eur_amount, "EUR")
print("rate observed at", data["as_of"], "status:", data["status"])

If you need the inverse itself, for example to show "1 USD = x EUR" on a page, compute Decimal(1) / rate and format it for display only.

For a deeper look at the language-specific setup, see the Python currency converter guide.

When to invert and when to fetch the reverse pair

Inverting is fine in some situations and risky in others.

Invert locally when:

  • You hold a single mid-market rate and need the other direction at the same moment, for the same observation.
  • You are displaying a reference rate in both directions on one screen.
  • You want to save a request and the two directions must be consistent with each other.

Ask for the reverse pair directly when:

  • You need an exact converted amount. Call the convert endpoint in the direction you need and let it do the arithmetic.
  • The direction matters for a record you will keep, such as an invoice or a refund, and you want the stored rate to be the one actually used.
  • You want a fresh observation. An inverted rate carries the as_of of the rate it came from. Check the status field before you reuse it; the stale rate guide covers what to do when it says stale.

Here are both directions with curl:

curl -s -H "Authorization: ApiKey $GETRATESAPI_KEY" \
  "https://api.getratesapi.com/v1/rates/EUR/USD"

curl -s -H "Authorization: ApiKey $GETRATESAPI_KEY" \
  "https://api.getratesapi.com/v1/rates/USD/EUR"

curl -s -H "Authorization: ApiKey $GETRATESAPI_KEY" \
  "https://api.getratesapi.com/v1/convert?from=USD&to=EUR&amount=500.00"

Each call costs 1 request unit. The /v1/convert response includes a converted_amount that is not rounded, so you round it yourself to the currency's minor unit.

Real-world cases where 1/rate is not the whole story

Bid, ask and spreads

A mid-market rate sits halfway between the price to buy and the price to sell. Its inverse is another mid-market rate. A bank or card network rate is different: they quote a buy rate and a sell rate with a spread. The reverse direction is not simply 1 / rate, because the spread works against you both ways. If you are comparing what a customer actually gets, read mid-market rate vs bank rate. If you charge a margin, apply it explicitly, as shown in adding a margin to live rates, in the direction of each transaction.

Pairs nobody quotes directly

Many pairs, such as a small fiat currency against a lesser-known crypto asset, have no direct market. They are computed through a pivot currency such as USD, EUR or BTC. GetRatesAPI handles this for any pair and marks the result with "type": "derived"; its as_of is the oldest of its inputs. The method is explained in cross rates. Whether a pair is direct or derived, the inverse rule is the same: keep full precision, divide once.

Crypto and tiny numbers

Inverting a crypto price can give you a number with many leading zeros, like how many BTC one cent buys. Floats lose digits quickly there. Use exact decimals throughout; crypto decimal precision goes into the details.

A short checklist

  • Store the rate you used, its as_of, and its direction (base and quote).
  • Convert by dividing by the stored rate when going the other way.
  • Compute inverses with a decimal type at high precision.
  • Round once, at the end, to the currency's minor unit.
  • Do not assume 1 / rate equals a separately fetched reverse rate; they are separate observations and may differ in time.
  • Add any margin explicitly instead of hiding it in an inverted number.

Try it on live rates

GetRatesAPI gives you about 170 fiat currencies, gold and silver, and thousands of crypto assets through one REST API, with rates as exact decimal strings and a freshness flag on every response. Create a free key at the sign-up page, no credit card needed, and try both directions of any pair in the dashboard playground. Plan limits are on the pricing page, and the current rate reference lists every field.

All articles →
Inverse Exchange Rate: Calculate the Reverse Pair — GetRatesAPI