Skip to content
๐Ÿ› ๏ธToolsShed

Exchange Rate Calculator

Convert one amount to multiple currencies simultaneously.

Rates are approximate reference values. Use a live currency service for actual transactions.

About this tool

The Exchange Rate Calculator converts a single amount into several currencies at once, so you can see its value across multiple currencies side by side. Instead of converting one pair at a time and juggling separate results, you get one figure expressed in many currencies together.

Enter an amount and choose a base currency, then pick the target currencies you care about; the tool shows every conversion at once. It is handy for travel budgeting, comparing prices across international stores, and for freelancers or shoppers who routinely deal with several currencies.

Keep in mind that the rates here are indicative, meant for reference and quick comparison rather than live dealing quotes; always confirm with your bank before an actual transaction. Everything runs locally in your browser.

Frequently Asked Questions

Code Implementation

def convert_currency(amount, from_rate_usd, to_rate_usd):
    """
    Convert amount between two currencies using USD as a base.

    Parameters:
        amount        - value to convert
        from_rate_usd - units of from-currency per 1 USD
        to_rate_usd   - units of to-currency per 1 USD

    Returns the converted amount.
    """
    amount_in_usd = amount / from_rate_usd
    return amount_in_usd * to_rate_usd


# Hardcoded reference rates (units per 1 USD)
RATES = {
    "USD": 1.0,
    "EUR": 0.92,
    "GBP": 0.79,
    "JPY": 149.50,
    "KRW": 1325.0,
    "CNY": 7.24,
    "CAD": 1.36,
    "AUD": 1.53,
    "CHF": 0.90,
    "INR": 83.10,
}


def convert(amount, from_currency, to_currency, rates=RATES):
    """Convert amount from one currency to another."""
    if from_currency not in rates or to_currency not in rates:
        raise ValueError("Unsupported currency code")
    return convert_currency(amount, rates[from_currency], rates[to_currency])


# Example: convert 100 EUR to JPY
result = convert(100, "EUR", "JPY")
print(f"100 EUR = {result:,.2f} JPY")

# Convert 1 USD to all currencies
for code, rate in RATES.items():
    print(f"1 USD = {rate:>10.4f} {code}")

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.