ForHosting KIT · Home, food & hobbies

Buy one get one discount calculator

Take five items on a buy-one-get-one deal and you pay for three, two come at no charge and the real discount is 40 %. Enter the unit price, the quantity and the deal's two numbers to see your discount and total. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Unit price
10
Quantity
5
Buy qty
1
Free qty
1
You get
Group size
2
Deal cycles
2
Remainder
1
Paid items
3

Retail promotions such as buy one get one free, buy two get one free, and other buy-X-get-Y-free stickers look simple on the shelf and turn fuzzy at checkout when the cart quantity is not a clean multiple of the deal cycle. Shoppers want a single honest number: what effective discount percentage am I really getting, and what is the payable total after free items are applied. Non-positive quantities are rejected with a clear validation error so nonsense carts never become fake discounts.

How buy-X-get-Y-free discount percent is computed

Start from a single unit list price expressed in one currency unit. Next choose quantity, the number of those identical items you take to the register, which must be a positive integer because checkout counts whole units. Classic buy one get one free is X equals one and Y equals one; buy two get one free is X equals two and Y equals one.

The deal group size is X plus Y. Complete deal cycles equal the integer floor of quantity divided by group size, and the remainder is quantity modulo group size. Free items equal complete cycles times Y plus the free remainder max of zero and remainder minus X: you still pay the first X items of an incomplete group, and only items past X in that remainder become free, up to Y per full cycle.

Paid items equal quantity minus free items. Effective discount percentage is one hundred times savings divided by list total when list total is positive, and zero when the list total is zero so free list goods do not invent Infinity. The capability does not stack coupons, apply sales tax, model multi-SKU mixed carts where the cheapest free rule matters, or convert currencies; those are separate product intents with their own landings when coverage grows.

Where BOGO discount calculators show up in real work

Grocery and apparel shoppers constantly compare buy one get one free stickers against percentage-off sales and need an effective discount percentage that accounts for cart size not landing on a clean multiple of the deal cycle. Merchants and e-commerce operators building promotion pages want a transparent payable total so advertised savings match the register and returns do not spike from misunderstood free-item rules. Journalism and comparison sites that rate weekly supermarket deals convert shelf promotions into a single percent-off figure so readers can rank offers fairly.

If you later need multi-SKU cheapest-item-free carts, stacked coupon engines, tax-inclusive totals, or multi-currency conversion, treat those as separate search intents and landings rather than overloading this buy one get one discount calculator page.

Shelf BOGO vs percent-off sales

Convert buy-X-get-Y-free stickers into an effective discount percentage for a real cart quantity so shoppers can compare against flat percent-off promotions.

Promotion page honesty checks

Compute payable totals and free-item counts for advertised BOGO deals so merchant landing pages match checkout arithmetic.

How does buy-X-get-Y-free free-item counting work?

Each full group of X+Y items grants Y free items. For the leftover remainder r, free extras equal max(0, r − X). Paid items equal quantity minus free items.

Does it handle mixed prices or multi-SKU carts?

Mixed-SKU “cheapest free” rules and stacked coupons are out of scope for this calculator.

What does it cost?

The browser tool is free and runs locally.

Why is the discount not half on five items?

Because the fifth item starts a new deal group that never completes, and in an incomplete group you still pay for the first items you must buy. So you pay for three of five items and the effective discount is 40 %.

Does it include sales tax or coupons?

No. It does not stack coupons, add sales tax or convert currencies. It works with one unit price for identical items and shows the discount that comes from the buy-X-get-Y deal alone.

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/bogo-discount

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/bogo-discount \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"unit_price":10,"quantity":5,"buy_qty":1,"free_qty":1}'
{
  "unit_price": 10,
  "quantity": 5,
  "buy_qty": 1,
  "free_qty": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "life.bogo_discount",
  "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.

How buy-X-get-Y-free discount percent is computed

That figure is unit_price: the shelf price of one identical item before the promotion, kept in one unit for the whole calculation so no silent currency conversion creeps in. Then set buy_qty to X and free_qty to Y for the deal wording buy X get Y free. List total is unit_price times quantity; payable total is unit_price times paid items; savings is list total minus payable total. The pipeline is deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift, so identical inputs always produce identical JSON. Quantity, buy_qty, and free_qty must be finite positive integers; zero or negative quantities fail with invalid_input rather than inventing a discount. Negative unit_price fails; zero unit_price is allowed and yields zero totals and zero discount percent.

What you send and what you get back

Classic checks include unit price ten with quantity five under buy one get one free: free items two, paid items three, list fifty, payable thirty, savings twenty, discount percent forty. Another check is unit price twelve with quantity seven under buy two get one free: free items two, paid items five, list eighty-four, payable sixty, savings twenty-four, discount percent about twenty-eight point five seven. Send four required fields. unit_price is a finite number greater than or equal to zero for the list price of one item. quantity is a positive integer for how many items you take. buy_qty is a positive integer X for the paid side of the deal cycle. free_qty is a positive integer Y for free items granted after each full paid block of X. Missing fields, non-numeric strings, NaN, Infinity, fractional quantity fields, zero or negative quantity fields, and negative unit_price fail with invalid_input and are not charged. On success the response echoes cleaned unit_price, quantity, buy_qty, and free_qty, reports group_size as X plus Y, deal_cycles as complete groups, remainder as leftover items, paid_items and free_items as the checkout split, list_total and payable_total and savings as money figures in the same unit, and discount_percent as the effective percentage off the list total. deal_label is a short human string such as buy 1 get 1 free, method is bogo_discount, and formula documents free_items equals floor of quantity over X plus Y times Y plus max of zero and remainder minus X so blogs and offer letters can cite the same expression. A zero or negative quantity request fails with a hard invalid_input mentioning non-positive quantities. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where BOGO discount calculators show up in real work

Personal finance educators teaching consumer math assign BOGO worksheets and need deterministic JSON for auto-graders rather than hand-typed totals that drift under rounding. Product teams shipping cart widgets reuse the same cycle arithmetic in browser and API so offline mockups and production never disagree. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Consumer-math fixtures and auto-graders

Bulk-produce list vs payable totals for classroom BOGO problems and reject non-positive quantities with a hard invalid_input.

What is the effective discount percentage?

discount_percent = 100 × (list_total − payable_total) / list_total when list_total is positive. It is the true percent off list after free items, not a nominal shelf claim.

What inputs are rejected?

Non-positive or non-integer quantity, buy_qty, or free_qty; negative unit_price; missing fields; NaN or Infinity. Those fail with invalid_input and are not charged.

Read the full KIT documentation →