{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"unit-price"},"result":{"entity_type":"calculator","id":"unit-price","calculator_id":"unit-price","canonical_url":"https://tttkmbb.com/everyday/unit-price","name":"Unit Price Comparison Calculator","title":"Unit Price Calculator – Compare Price per Unit of Two Package Sizes","category":"everyday","category_name":"Everyday Life","tool_name":"calculate_unit_price","featured_mcp_tool":false,"description":"Divides each price by its quantity to get the price per unit, tells which of two options is cheaper per unit and by what percentage.","use_when":"You are comparing two package sizes or brands of the same product (e.g. 500 g for 3.49 vs 1 kg for 5.99) and want the better value per unit.","do_not_use_when":"The two quantities are in different units (convert them to the same unit first, e.g. with mass or volume), or you need a discount on a single price (use discount).","inputs":[{"name":"price_a","label":"Price of option A","type":"number","required":true,"min":0,"max":100000000,"description":"Total price of option A.","example":3.49},{"name":"quantity_a","label":"Quantity of option A","type":"number","required":true,"max":1000000000,"exclusive_min":0,"description":"Quantity in option A (grams, kilograms, litres, pieces …).","example":0.5},{"name":"price_b","label":"Price of option B","type":"number","required":true,"min":0,"max":100000000,"description":"Total price of option B.","example":5.99},{"name":"quantity_b","label":"Quantity of option B","type":"number","required":true,"max":1000000000,"exclusive_min":0,"description":"Quantity in option B, in the same unit as quantity_a.","example":1}],"outputs":[{"name":"unit_price_a","label":"Unit price A","type":"number","decimals":4,"description":"price_a / quantity_a, per one unit of quantity."},{"name":"unit_price_b","label":"Unit price B","type":"number","decimals":4,"description":"price_b / quantity_b."},{"name":"cheaper_option","label":"Cheaper per unit","type":"string","decimals":4,"description":"'Option A', 'Option B' or 'Same unit price'."},{"name":"savings_percent","label":"Savings","type":"number","unit":"%","decimals":2,"description":"How much lower the cheaper unit price is, relative to the more expensive one."},{"name":"unit_price_difference","label":"Difference per unit","type":"number","decimals":4,"description":"|unit_price_a − unit_price_b|."}],"input_schema":{"type":"object","properties":{"price_a":{"description":"Total price of option A.","type":"number","minimum":0,"maximum":100000000,"examples":[3.49]},"quantity_a":{"description":"Quantity in option A (grams, kilograms, litres, pieces …).","type":"number","maximum":1000000000,"exclusiveMinimum":0,"examples":[0.5]},"price_b":{"description":"Total price of option B.","type":"number","minimum":0,"maximum":100000000,"examples":[5.99]},"quantity_b":{"description":"Quantity in option B, in the same unit as quantity_a.","type":"number","maximum":1000000000,"exclusiveMinimum":0,"examples":[1]}},"additionalProperties":false,"required":["price_a","quantity_a","price_b","quantity_b"]},"output_schema":{"type":"object","properties":{"unit_price_a":{"description":"price_a / quantity_a, per one unit of quantity.","type":"number"},"unit_price_b":{"description":"price_b / quantity_b.","type":"number"},"cheaper_option":{"description":"'Option A', 'Option B' or 'Same unit price'.","type":"string"},"savings_percent":{"description":"How much lower the cheaper unit price is, relative to the more expensive one. Unit: %.","type":"number","x-unit":"%"},"unit_price_difference":{"description":"|unit_price_a − unit_price_b|.","type":"number"}}},"formula":"unit_price = price / quantity; savings_percent = (max(unit_price_a, unit_price_b) − min(unit_price_a, unit_price_b)) / max(unit_price_a, unit_price_b) × 100","sources":[{"name":"Unit price (Wikipedia)","url":"https://en.wikipedia.org/wiki/Unit_price","type":"reference","retrieved_at":"2026-09-23"},{"name":"EU Directive 98/6/EC on the indication of unit prices","url":"https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:31998L0006","type":"standard","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"0.5 kg for 3.49 vs 1 kg for 5.99","inputs":{"price_a":3.49,"quantity_a":0.5,"price_b":5.99,"quantity_b":1},"expected":{"unit_price_a":6.98,"unit_price_b":5.99,"cheaper_option":"Option B","savings_percent":14.18,"unit_price_difference":0.99},"url":"https://tttkmbb.com/api/v1/calculate/unit-price?price_a=3.49&quantity_a=0.5&price_b=5.99&quantity_b=1"},{"name":"12 eggs for 2.00 vs 18 eggs for 3.30","inputs":{"price_a":2,"quantity_a":12,"price_b":3.3,"quantity_b":18},"expected":{"unit_price_a":0.1667,"unit_price_b":0.1833,"cheaper_option":"Option A","savings_percent":9.09,"unit_price_difference":0.0167},"url":"https://tttkmbb.com/api/v1/calculate/unit-price?price_a=2&quantity_a=12&price_b=3.3&quantity_b=18"}],"faq":[{"q":"Which unit should I use for the quantities?","a":"Any unit, as long as both options use the same one; unit prices are then per that unit. Using kg or L instead of g or ml gives more readable unit prices."},{"q":"Is the larger package always cheaper per unit?","a":"No. Promotions on small sizes frequently undercut bulk packs, which is exactly what this comparison reveals."}],"tags":["unit price","price per unit","price comparison","cost per kg","better value"],"related":[{"calculator_id":"discount","reason":"Apply a percentage discount to a price."},{"calculator_id":"percentage-change","reason":"Percentage difference between two prices."}],"links":{"html":"https://tttkmbb.com/everyday/unit-price","markdown":"https://tttkmbb.com/everyday/unit-price.md","json":"https://tttkmbb.com/everyday/unit-price.json","api":"https://tttkmbb.com/api/v1/calculate/unit-price","schema":"https://tttkmbb.com/api/v1/calculators/unit-price","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:29:35Z","next_actions":[{"tool":"run_calculator","calculator_id":"unit-price","reason":"Run Unit Price Comparison Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/everyday/unit-price.md"}}