Unit price comparison calculator

This tool turns the prices of several pack sizes into a price per unit and shows which one is cheaper; it is made for shoppers and purchasing staff who compare supplies. Unlike a basic free calculator, it names the cheapest item, shows the savings against the most expensive one, and points to the exact line when an input is wrong. Type one line per item with its pack size and its price, for example 12 3.60, and the tool divides the price by the size. Decimal commas such as 12,5 are read as 12.5, and thousands commas such as 1,234 as 1234. Everything is calculated in your browser, so your prices never leave your device.

Runs in your browser; what you type never leaves your device.

Items

One item per line: pack size, then price. Use the same unit for every item.

Your comparison

Enter one line per item, such as 12 3.60, to compare unit prices.

Cheapest item
—
Best unit price
—
Savings vs most expensive (%)
—
Unit price per item
—
Items compared
—

This is a calculation aid; check that every item uses the same unit and that quality and shipping are comparable.

How to use it

  1. Write one line per item: pack size, then price, for example 12 3.60.
  2. Use the same unit for every item, such as pieces, grams or metres.
  3. Read the unit price of each item, the cheapest item and the savings.

Frequently asked questions

How do I calculate the unit price?

Divide the price by the pack size. A pack of 12 for 3.60 costs 3.60 ÷ 12 = 0.30 per piece, so you can compare it with any other pack size.

What does the savings percentage mean?

It shows how much cheaper the best item is than the most expensive one, as a percent of the higher unit price. Units of 0.30 and 0.40 give a saving of 25 percent.

What happens when two items cost the same per unit?

Prices count as tied when they show the same on screen or are equal within a tiny relative tolerance (float noise such as 0.1 + 0.2 vs 0.3). Unit prices keep at least four significant digits, so 0.0123 and 0.0124 are never shown as the same number. The first of the tied items is shown as the best choice, and a note tells you how many items tie. The savings are still measured against the most expensive item.

Can I compare different units, like grams and kilograms?

Not in this version. Convert every item to the same unit first, for example all in grams, then enter the sizes. Unit conversion may come in a later version.

Why do I get an error?

The tool needs at least two items, a pack size above zero and a price of zero or more. Each line must have exactly two numbers, and the message names the line to fix.

How are commas in numbers read?

One comma followed by one or two digits is a decimal comma: 12,5 is 12.5 and 3,60 is 3.6. A comma followed by exactly three digits is a thousands separator: 1,234 is 1234 and 1,234.5 is 1234.5. Anything else with a comma is rejected with an error message.

Version 0.1.0 · Updated 2026-11-13