How the Unit Price Calculator Works
Every product is converted to a single comparable unit price within one measure type. Weight options are normalised to grams and priced per 100 g; volume options are normalised to millilitres and priced per litre; count options are priced per item. The formula is unit price = price ÷ (size × pack count × unit factor) × display scale, where the unit factor converts the chosen unit to the base (1 oz = 28.349523125 g, 1 lb = 453.59237 g, 1 fl oz = 29.5735295625 ml, 1 L = 1000 ml). The options are ranked by unit price ascending, the lowest is marked best value, and each item’s saving versus the most expensive option is reported as a percentage. All of this is produced by a pure function in a small, unit-tested engine.
- Unit price = price ÷ (size × pack × unit factor) × display scale
- Weight → per 100 g, volume → per litre, count → per item
- Conversions: 1 oz = 28.3495 g, 1 lb = 453.592 g, 1 fl oz = 29.5735 ml
- Lowest unit price is ranked first as the best value
- All math is client-side JavaScript with no server round-trip
