ForHosting KIT · Home, food & hobbies

Price per 100g calculator

A 500 g pack at 1.5 and a 2000 g bag at 3 cost 0.3 and 0.15 per 100 g, so the big bag wins even with the higher sticker. Enter each pack's shelf price and net weight and the cheapest is highlighted. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Grocery shelves rarely put equal packs side by side: a five-hundred-gram store brand, a four-hundred-gram premium pouch, and a two-kilogram bulk bag all quote different shelf prices, so the cheaper sticker is often not the better deal. This price per 100 grams calculator normalizes every option to the same mass basis, returns a clear unit price for each product, and highlights the cheapest choice by cost per hundred grams so shoppers, meal planners, and price-comparison apps can decide without mental arithmetic. Zero or negative weight fails with invalid input because unit price is undefined without a positive mass.

What to send: products, prices, and weights in grams

Each entry is an object with a non-negative shelf price and a positive net weight in grams. Optional name, label, title, product, or sku gives a human-readable row label for receipts and UI tables; if you omit the name the engine assigns Product one, Product two, and so on in list order. At least one product is required; an empty array fails validation before any division.

Negative prices are rejected because a normal shelf comparison does not use refunds as unit prices. All validation runs before unit-price math, so a bad list never returns half-filled rows. Convert kilograms yourself by multiplying by one thousand before calling: this product intentionally stays on a single gram basis for SEO clarity and stable contracts.

Supermarket aisle decisions

Shoppers enter two or three pack sizes with shelf prices and instantly see which option is truly cheapest per 100 grams before they fill the cart.

Meal planning and bulk buying

Home cooks and bulk buyers compare family packs against smaller pouches on a fair mass basis when building weekly menus and pantry restocks.

What happens if weight is zero or negative?

Price per 100g is undefined without a positive mass, so zero and negative weights are rejected and not charged.

Do I need product names?

Names are optional. If you omit name (or label/title), the engine labels rows Product 1, Product 2, and so on while still computing unit prices.

Is the price per 100g calculator free?

The browser tool runs free on your device.

How do I calculate the price per 100 grams?

Divide the shelf price by the weight in grams and multiply by 100. A 500 g pack at 1.5 works out at 0.3 per 100 g, which you can then compare with any other pack size.

What if the pack weight is in kilograms?

Multiply it by 1000 first and enter the result in grams, so a 2 kg bag becomes 2000 g. Keeping every product on grams is what makes the comparison fair.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/life/price-per-100g

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/life/price-per-100g \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"products":[{"name":"Store brand pasta","price":1.5,"weight_g":500},{"name":"Premium pasta","price":1.2,"weight_g":400},{"name":"Bulk pasta","price":3,"weight_g":2000}]}'
{
  "products": [
    {
      "name": "Store brand pasta",
      "price": 1.5,
      "weight_g": 500
    },
    {
      "name": "Premium pasta",
      "price": 1.2,
      "weight_g": 400
    },
    {
      "name": "Bulk pasta",
      "price": 3,
      "weight_g": 2000
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "life.price_per_100g",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The engine is fully deterministic pure math: identical product lists always produce identical JSON, with no network calls, random seeds, or wall-clock drift.

What to send: products, prices, and weights in grams

Send a JSON body with a required products array—aliases items, options, list, and goods are accepted when your client already uses another field name. Price may arrive as a number or a numeric string; aliases cost, amount, and shelf_price map to the same value so checkout and catalog systems can keep familiar keys. Weight must be the edible or sellable net mass in grams, not the outer carton; aliases weight, grams, mass_g, net_weight_g, and weight_grams are supported. Zero weight and negative weight both raise invalid_input with a message that weight must be positive grams—the classic trap when a barcode feed leaves mass blank or inverted. Extremely large prices or weights are capped so Worker isolate math stays bounded.

How price per 100 g is computed and how the cheapest option is chosen

For every product the engine applies the familiar retail formula: price per one hundred grams equals shelf price divided by weight in grams, then multiplied by one hundred. Shelf price is echoed rounded to two decimal places for receipt-style display, while weight_g is returned as the validated positive number you sent. Each result row includes its zero-based index, display name, price, weight_g, and price_per_100g. The cheapest object is the row with the lowest price_per_100g; if two packs tie exactly, the earlier list entry wins so the outcome is fully deterministic. When two or more products are present, savings_vs_most_expensive_per_100g reports how much lower the winner is than the most expensive unit price on the same hundred-gram basis—handy for badges like save this much per hundred grams. A single-product list still returns that product as cheapest with zero savings, which is useful for pipelines that always want the same response shape. The method field is always price_per_100g and unit is always per_100g so downstream code can branch without sniffing shapes. Missing products, empty lists, missing price, missing weight, non-numeric fields, zero weight, and negative weight all fail with invalid_input and are not charged after rejection.

API usage, pricing, shopping workflows, and practical limits

Call the free in-browser price per 100g calculator when you are standing in an aisle, planning a weekly shop, or teaching unit-price literacy without installing another app. Keep lists within ordinary shopping sizes; the published product cap protects isolate runtime while still covering full trolley comparisons. The product promise is transparent unit-price comparison on a hundred-gram basis, not live web scraping of competitor pages—those intents belong to price extract and price monitor tools with different search terms and engines. Use the prepaid API when a meal-planning service, grocery bot, budget coach, bulk-buy helper, or catalog normalizer needs a stable KIT contract at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with currency converters only when all shelf prices already share one currency—this capability does not convert foreign exchange or apply tax, multi-buy offers, or loyalty discounts. Authors shipping SDKs can map the products array into comparison tables and surface cheapest.name plus cheapest.price_per_100g in a summary banner.

Budget apps and grocery bots

Expense apps and chatbots call a stable prepaid endpoint instead of reimplementing unit-price math and zero-weight guards in every client language.

How do I calculate price per 100g for several products?

Send JSON with a products array. Each item needs price and weight_g (grams). The response lists price_per_100g for every row and a cheapest object with the lowest unit price.

What if two products have the same unit price?

The first product in your list with that minimum price_per_100g is returned as cheapest, so ties are resolved deterministically.

Read the full KIT documentation →