CruxDevCruxDev Tools Prompts
finance Utility • Zero-Server Privacy • 100% Client-Side

Unit Price Comparison

Compare two products by price per gram, liter, or piece to instantly find the better value.

Overview

A shopping comparison calculator that converts two products into price per unit — per gram, kilogram, millilitre, litre, piece, or metre — and tells you which one is cheaper per unit and by what percentage. It turns package-size arithmetic at the shelf into a single comparable number.

How It Works

For each product, enter its price, its quantity, and its unit from a dropdown covering g, kg, ml, l, pcs, and m. The tool divides price by quantity for both and displays the unit price of each, highlighting the cheaper one in green with a line stating how much better value it is in percentage terms. If both cost the same per unit, it says so instead of arbitrarily picking a winner.

Step-by-Step Usage Guide

  1. Enter product A's price and package quantity, and pick its unit.
  2. Do the same for product B, using the same unit.
  3. Read both unit prices and the highlighted cheaper option.
  4. Use the percentage figure to judge whether the saving justifies a bigger package.

Technical Specifications & Standards

Unit price is price divided by quantity, with the quantity guarded by a tiny epsilon so a zero entry cannot divide by zero. The percentage advantage is computed as the absolute difference between the two unit prices divided by the higher one, so '12.5% better value' means the winner costs 12.5 percent less per unit than the loser. One limitation to respect: the tool compares the two unit prices numerically without converting units. If you enter product A in grams and product B in kilograms, the comparison is meaningless — 4.50 per g versus 8.90 per kg are different scales — and the cheaper badge would be wrong. Use the same unit for both products (the defaults are both in grams for this reason), or convert one yourself first: 1 kg equals 1,000 g and 1 litre equals 1,000 ml. Also note the tool assumes the products are genuinely comparable goods; a larger package is only better value if you will actually use all of it before it spoils, which no arithmetic can decide for you.

Targeted Use Cases

  • Comparing a 500 g pack with a 1 kg pack at different prices.
  • Deciding between a 330 ml bottle multipack and a 1.5 litre bottle.
  • Checking whether the 'family size' really costs less per piece.
  • Comparing fabric or cable priced per metre in different roll lengths.

Notes & Gotchas

  • Always select the same unit for both products, or convert before comparing.
  • Compare like with like — same product category and quality, different sizes.
  • Factor in wastage and shelf life; the cheapest per gram is not cheapest if half spoils.
  • Watch promotional rounding: enter the actual ticket price, not the rounded tag.

Frequently Asked Questions

Can I compare grams against kilograms directly?

No. The tool divides each price by its quantity and compares the numbers as-is, so both products must use the same unit. Convert first: 1 kg = 1,000 g and 1 litre = 1,000 ml.

How is the 'better value' percentage calculated?

As the difference between the two unit prices divided by the more expensive one. If product A costs 4.50 per unit and B costs 5.10, A is about 11.8 percent cheaper per unit.

What happens if quantity is zero?

The division is guarded, so a zero or empty quantity cannot crash the page, but the unit price it produces is not meaningful. Enter the real package quantity for a valid comparison.

Are currencies supported?

The figures display with a dollar-sign formatting convention, but the arithmetic is currency-neutral: enter prices in your own currency and the per-unit comparisons and percentages remain valid.