Limited Coin Change Calculator

Enter face values, counts and the coins you need to keep. See which amounts you can make, how many denomination combinations reach them, and the fewest usable coins required.

Bounded coin change

Find exact change with the coins you have

Count your stock, keep a reserve and find the fewest usable coins for your amount.

Coin stock and target

One row per value. Enter denomination, counted, reserve.

Use the same whole unit everywhere. For cents, enter 235 for $2.35.

Exact change is available.

Target and reachable alternatives

Counted value
92 units
Value to keep
37 units
Usable value
55 units

30 units

3 minimum · 1 combination

25 units

1 minimum · 1 combination

35 units

2 minimum · 1 combination

Largest-first uses 1 coin and leaves 5 units unfilled.

Reachable amounts and minimum pieces
Minimum coins for nearby reachable amountsTarget 30 can be made with a minimum of 3 coins.20 units · 2 minimum coins · 1 combinations25 units · 1 minimum coins · 1 combinations30 units · 3 minimum coins · 1 combinations35 units · 2 minimum coins · 1 combinationsMinimum coinsScale 32040 units

Each column is one unit. The shaded column is the target. A short gray tick marks an unreachable amount. An outline marks the inspected amount.

Minimum-piece allocation

Target · 30 units using 3 coins

ValueUseLeftKeep
25021
10300
5022
1022

Left is the remaining count after this allocation. Keep is the reserve entered for that value.

Export the coin change audit

View CSV text

How to use this calculator

  1. Enter each denomination, counted coins and the minimum number to keep on a separate line.
  2. Use one whole unit across the worksheet. For cents, enter 235 for an amount of $2.35.
  3. Check the target and closest reachable alternatives. Select an amount to see the allocation and remaining stock.
  4. Compare the reachable amounts and download the exact audit.

The Formula

The mathematical logic powering this calculation is:

For each entered denomination d, usable count u equals counted coins minus the reserve. All amounts use the same whole unit, such as cents. The algorithm starts with one way to make zero using zero coins. At the next denomination, extend each reachable previous amount v by q × d for every integer q from 0 through u. Add the previous combination count to the new amount for each extension. For the fewest pieces, minimize the previous minimum plus q over extensions yielding the same amount. Treat equal-valued coins as interchangeable. Each denomination is processed once.

The workspace reconstructs a minimum-piece choice for the target and the closest reachable amounts strictly below and above it. When several allocations use the minimum number of coins, it chooses more of the highest denomination at which they differ. It applies each allocation to the same original stock. The remaining counts always keep at least the specified reserve.

The largest-first comparison separately takes as many usable coins as fit at each denomination, in descending value order. It can leave a gap or use more pieces than the exact calculation. The left-to-right chart shows the minimum pieces for reachable nearby amounts. The table and CSV give counts of distinct combinations. Other reachable amounts can lie outside the chosen chart width.

Enter 1 to 8 distinct denominations from 1 to 1,000 units, with 0 to 40 counted coins per denomination and a reserve at most the counted amount. The target accepts 0 to 5,000 units. The empty allocation is one way to make zero. All feasibility and combination calculations are exact.

Worked Example

If you input:

  • Stock: Two 25s with one reserved, three 10s available, two 5s and two 1s reserved.
  • Target: 30 units

Result:

Three 10s make 30 in the only exact combination. Largest-first uses one 25 and leaves 5 unfilled. The closest other reachable amounts are 25 and 35.

Frequently Asked Questions

Can the drawer contain enough value and still lack exact change?

Yes. The usable coins must sum exactly to the target. The closest smaller and larger totals often show the gap left by the available denominations.

How are combinations different from orders?

A combination counts how many coins of each value are used. Switching the order of those same coins gives the same combination.

Why can largest-first fail?

It takes a large coin before checking whether the remaining denominations can finish the amount. With one usable 25 and three usable 10s, taking 25 toward 30 leaves 5. Three 10s complete the target.

Can I compare reachable alternatives without spending my reserve?

Yes. Every option uses the same entered stock and reserve. The allocation table shows how many coins would remain at each denomination.

Similar Calculators