Billed

Cost Per Unit Calculator

Divide the total cost of a batch by the units it produced to get the cost per unit, then see the price per unit that gives the gross margin you set.

Batch cost and units

Amounts are in dollars and cents. Enter the total cost and the units for the same batch or production run.

Everything the batch cost you, such as materials, labor and any overhead you assign to it.

A whole number. If some units are scrapped, enter only the good units, so the cost is spread over the units you can sell.

Gross profit as a percentage of the selling price, from 0 to 99.99. Leave it empty to see only the cost per unit.

Cost per unit

$20.00

$4,800.00 ÷ 240 units.

Price for a target gross margin

Price per unit for a 35.00% gross margin:

$30.77

Gross profit per unit (price − cost per unit)
$10.77
Sales for 240 units at this price
$7,384.80
Gross profit on the batch (sales − total cost)
$2,584.80
Gross margin at this price (gross profit ÷ sales)
35.00%
Markup on cost (gross profit ÷ total cost)
53.85%

Price = cost per unit ÷ (1 − target margin), rounded up to the next cent so the margin is at least your target. Percentages are rounded to 2 decimal places and amounts to the cent (half up).

How cost per unit and the price are worked out

  • Cost per unit = total cost ÷ units produced.
  • Price per unit = cost per unit ÷ (1 − target gross margin), rounded up to the next cent.
  • Sales = units × price. Gross profit = sales − total cost.
  • Gross margin = gross profit ÷ sales.
  • Markup on cost = gross profit ÷ total cost.

Example, using the calculator's starting values: a batch costs $4,800.00 and produces 240 units, so the cost per unit is $20.00. For a 35% gross margin, $20.00 ÷ 0.65 = $30.7692…, rounded up to $30.77. Selling 240 units at $30.77 brings in $7,384.80, a gross profit of $2,584.80 ($10.77 per unit). That's a gross margin of 35.00% and a markup on cost of 53.85%.

The price is rounded up rather than to the nearest cent so the margin isn't below your target. The margin and markup are rounded to 2 decimal places, and amounts to the nearest cent, with half rounding up.

The definitions come from OpenStax (opened October 29, 2026). Principles of Finance, section 5.1 gives “gross margin = gross profit/sales”, and Contemporary Mathematics, section 6.2 describes markup as the amount added to the cost: “This increase is called the markup.”

What the price covers

The price covers the costs in the total you enter, plus the margin. It doesn't include sales tax, and costs outside the batch, such as rent or selling costs, are only covered if you add them to the total. To find the number of units you need to sell to cover your fixed costs, use the break-even calculator. To check the profit, margin and markup on revenue and cost you already know, use the profit margin calculator. For the costs behind the numbers, read what is cost of revenue and what is marginal cost, the cost of producing one more unit.

Frequently Asked Questions

Track the costs behind your prices

In Billed you can record each expense with who you paid, how much and its category, with the receipt attached, and save your products and services so they're ready to add to your estimates.

No credit card required.