Unit Price Calculator
This unit price calculator compares two products using total price divided by pack count times size per pack. It converts grams to kilograms and millilitres to litres, or compares item counts, while refusing comparisons between different measurement dimensions.
By Dr. Hassan Khames EliwaLast updated
Result
- Product A unit price
- $6.000000 / kg
- Product B unit price
- $5.000000 / kg
- Product A total quantity
- 1 kg
- Product B total quantity
- 1 kg
- Unit savings versus higher price
- 16.67%
How it works
Compare the amount you actually receive
For each product, enter the price of the entire offer, the number of packs included, and the size of each pack. Total quantity equals pack count × size per pack × conversion factor. Unit price equals the offer price divided by that total quantity. The calculator reports prices per kilogram, per litre, or per item so differently sized offers share a common denominator.
Grams are multiplied by 0.001 to obtain kilograms. Millilitres are multiplied by 0.001 to obtain litres. Kilograms, litres, and counts use a factor of one. Pack count must be a positive whole number, and count-based sizes must also be whole numbers. Mass and volume sizes may contain fractions. Size must be at least 0.000001 and no more than one billion in the selected unit; pack count is capped at one million.
Keep dimensions separate
Mass can be compared only with mass, volume only with volume, and count only with count. A kilogram of detergent is not automatically comparable to a litre of detergent: converting between them requires a product-specific density that this tool does not assume. Likewise, comparing one capsule with one millilitre is not a meaningful price calculation without additional product information.
The lower unit price wins. The percentage saving is the difference between higher and lower unit prices divided by the higher price. It describes savings for an equal quantity, not the percentage difference between checkout totals. A zero price is allowed for a genuinely free offer; two zero unit prices produce a tie with zero percentage savings. Very small floating-point differences are treated as ties, while unit prices are displayed to six decimals to make small per-item costs visible.
Worked example
Example 1: two smaller packs against one large pack
Product A costs $6 for 2 packs of 500 g each. Its total quantity is 1 kg and its unit price is $6.000000 per kg. Product B costs $5 for 1 pack of 1 kg, giving 1 kg at $5.000000 per kg. Product B has the better unit price, with 16.67% unit savings versus the higher price. Both offers deliver the same mass, so the one-dollar difference is also visible at checkout.
Example 2: a multipack of drinks
Product A costs $4.50 for 6 packs of 250 ml, totaling 1.5 L. Its unit price is $3.000000 per L. Product B costs $7 for 1 pack of 2 L, giving $3.500000 per L. Product A wins with 14.29% unit savings versus the higher price. Product B supplies more liquid, but the larger quantity does not make its price per litre cheaper.
Expert tips
Common mistakes
- Multiplying the price by pack count again. The price field is already the total price for the entire offer. Entering a per-pack price there understates the cost of a multipack.
- Mixing grams and millilitres. Similar-looking numbers do not make mass and volume equivalent. The calculator rejects that comparison rather than inventing a density or assuming every product behaves like water.
- Using the cheaper price as the percentage denominator. Savings versus the higher price divide by the higher unit price. A markup relative to the cheaper option is a different percentage and answers a different question.
For education, not financial advice. Results are estimates based on the inputs you give. Lenders, tax authorities and advisers may use different rules, fees and rounding. Check the numbers with a qualified professional before you commit to anything.
Frequently asked questions
Can I compare grams with kilograms?
Yes. Both describe mass, so the calculator converts each total to kilograms before division. A 500 g pack and a 0.5 kg pack therefore have the same quantity when pack counts match.
Can I compare litres with millilitres?
Yes. Both are volume units and results are reported per litre. Use the actual volume per container, not a serving suggestion, unless the entered price specifically purchases only that serving.
How do I compare paper towels or tablets?
Choose count and enter whole items per pack. This compares cost per counted item only. Differences in sheet area, tablet strength, or product quality remain outside the calculation and may change the practical buying decision.
What happens if both offers are free?
Both unit prices are zero, so the result is a tie and percentage savings are zero. Quantity is still calculated, but no division by a zero higher price is attempted.
Why do displayed prices sometimes look equal?
The comparison uses unrounded values while display uses six decimals. Close prices can round alike even when one is slightly lower. Inspect offer details rather than assuming a tiny numerical advantage outweighs quality or waste.
Related calculators
Related guides
FinancialThe 50/30/20 budget and how big an emergency fund should beUse percentages to start the conversation, then size your cash reserve around the bills that would survive an income shock.15 November 2026 · 8 min read
MathPercentages people get wrong: change, difference and pointsThe denominator determines the answer. Learn to distinguish percentage change, symmetric difference and percentage-point movements.14 November 2026 · 7 min readSources and standards
About the author
Dr. Hassan Khames Eliwa holds a PhD in Construction & Built Environment and has more than 20 years of international project controls experience. He is Director of Eliwa Project Controls Limited in Auckland and founder of PMMilestone.org and PMMilestone.com.
Buy me a coffee