ThisCalculator

Everyday

Change Calculator Formula: How to Count Coins & Bills

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Change Calculator Formula: How to Count Coins & Bills

This calculator works out the exact change you get back when you pay for an item with cash. You enter the price of the item and the amount you handed over, and it returns the total change due, broken down into the fewest coins and bills (for example, one $10 bill, one $5 bill, two $1 bills, and one quarter). The formula is simple subtraction, but the interesting part is how the calculator splits that difference into denominations.

Formula

The core formula is:

Change due = Cash paid − Item price

Where:

  • Cash paid is the amount of money you give the cashier (in dollars).
  • Item price is the cost of the item (in dollars).
  • Change due is the difference, also in dollars.

For the breakdown into coins and bills, the calculator uses a greedy algorithm: it starts with the largest denomination and uses as many as possible, then moves to the next smaller one. For U.S. currency, the denominations (in dollars) are: 100, 50, 20, 10, 5, 1, 0.25, 0.10, 0.05, 0.01.

Worked Example

Using the default values: item price = $23.45, cash paid = $50.00.

  1. Change due = $50.00 − $23.45 = $26.55
  2. Breakdown:
    • $20 bill: 1 (remaining $6.55)
    • $5 bill: 1 (remaining $1.55)
    • $1 bill: 1 (remaining $0.55)
    • Quarter ($0.25): 2 (remaining $0.05)
    • Nickel ($0.05): 1 (remaining $0.00)

So the breakdown is: 1 × $20, 1 × $5, 1 × $1, 2 × $0.25, 1 × $0.05. Total: $26.55.

How the Greedy Algorithm Works

The greedy algorithm is the standard method for making change with coins and bills. It works because most currency systems (including U.S. dollars, euros, and British pounds) are “canonical� – meaning the greedy approach always yields the fewest number of pieces. For each denomination from largest to smallest:

  • Divide the remaining change by the denomination.
  • Take the integer part as the count for that denomination.
  • Subtract the value of those pieces from the remaining change.
  • Move to the next lower denomination.

For example, after subtracting $20 from $26.55, you have $6.55. The next denomination is $5, so you take one $5 bill, leaving $1.55, and so on.

When to Use This Calculator

Use this calculator whenever you need to know how much change you should receive, or how to give change. Common situations:

  • At a cash register, to double-check a cashier’s arithmetic.
  • When you’re the cashier and need to make change quickly.
  • When you’re teaching kids about money and making change.
  • When you’re planning a cash payment and want to avoid receiving too many coins.

It’s also useful for budgeting: if you pay with a larger bill, you know exactly what coins and bills to expect back.

Common Mistakes and Misconceptions

One common mistake is forgetting to subtract cents correctly. For example, if an item costs $9.95 and you pay with a $10 bill, the change is $0.05, not $0.10. Always align the decimal points.

Another mistake is assuming that the breakdown is unique. In most cases, there are many ways to make change (e.g., $0.25 can be one quarter, or two dimes and a nickel, or five nickels). The calculator gives the fewest number of coins/bills, which is the standard convention.

Also, note that the greedy algorithm works for U.S. currency, but not for all currency systems. For example, if a currency had a 30-cent coin and a 40-cent coin, the greedy algorithm would not always give the fewest coins. But for standard currencies, it’s fine.

Limitations of the Formula

The formula assumes that you are paying with cash and that the cashier has enough change to give you the exact amount. It doesn’t account for:

  • Sales tax that might be added to the price (you should enter the final price including tax).
  • Cashier rounding (some countries round cash transactions to the nearest 5 cents).
  • If you pay with a combination of bills and coins (e.g., $50 bill plus a quarter). In that case, add the total paid.

Also, the breakdown assumes U.S. denominations. If you’re in another country, you can still use the total change, but the breakdown won’t match local currency.

Frequently Asked Questions

What if I pay with a $100 bill for a $23.45 item?

Change = $100.00 − $23.45 = $76.55. Breakdown: one $50 bill, one $20 bill, one $5 bill, one $1 bill, two quarters, one nickel. The calculator works the same way.

Why does the calculator show the fewest coins/bills?

Because that’s the most practical way to give change – it minimizes the number of pieces you have to handle. The greedy algorithm achieves this for standard currencies.

Can I use this for other currencies?

Yes, the total change calculation works for any currency as long as you enter the amounts in the same currency. The breakdown, however, is for U.S. denominations. For other currencies, you’d need to adjust the denominations.

What if the cash paid is less than the price?

The calculator will show a negative change, which means you haven’t paid enough. In real life, you’d need to give more money. The formula still works mathematically.

How do I handle cents when making change mentally?

Count up from the price to the amount paid. For example, from $23.45 to $50.00: add 5 cents to make $23.50, then 50 cents to make $24.00, then $1 to make $25.00, then $25 to make $50.00. That gives you $26.55. This is the “counting up� method many cashiers use.

Does the calculator include sales tax?

No, you should enter the final price including any tax. If the price is before tax, add the tax first, then use that as the item price.

Related

Formula used
in price | Item price | $ | 23.45 | 0
in paid | Cash paid | $ | 50.00 | 0
out change | Total change | $ | paid - price | 2
out breakdown | Breakdown (fewest coins/bills) | - | "See explanation" | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.