Optimal Batch Size Calculator
Enter annual demand, setup cost and holding cost, and this calculator returns the batch size that minimizes the sum of the two. It uses the economic order quantity (EOQ) when stock arrives all at once, and switches to the economic batch quantity (EBQ) when you make the product yourself at a finite production rate. Alongside the batch size you get batches per year, cycle time, the annual setup and holding cost split, and an optional reorder point from lead time and working days.
At the optimum, annual setup cost and annual holding cost are equal. If the two lines in your results are far apart, the batch size you entered is off the optimum in the direction of the larger cost. Cycle time is computed on 365 days; the reorder point uses your working days.
Quick Answer
For annual demand of 10,000 units, a $500 setup cost per batch and a $2 holding cost per unit per year, the optimal batch size is 2,236 units. That means 4.47 batches a year, an 81.62-day cycle between batches, and a total relevant cost of $4,472.14 a year, split exactly evenly: $2,236.07 of setup cost and $2,236.07 of holding cost. Type the same numbers into the calculator above and you get every one of those figures back.
Key takeaways
- The optimum is where the two cost curves cross. At 2,236 units the annual setup total and the annual holding total match to the dollar. If your own two totals are far apart, your batch size is off the optimum in the direction of the larger cost.
- Entering a production rate switches the model from EOQ to EBQ, the finite-rate correction. The same demand, setup and holding inputs with a 120,000-unit production rate give 6,547 units instead of 5,000, and save $4,724.75 a year.
- Holding cost can be entered as dollars per unit per year or as a percent of unit cost. Accountants usually quote a carrying-charge percent, and 25 percent of an $8 unit is $2, so the percent mode matches how the number actually arrives on your desk.
- Quick Answer
- How to use the optimal batch size calculator
- The optimal batch size formula: EOQ and EBQ
- Worked example: the pre-filled numbers, checked by hand
- EOQ vs EBQ: which model fits your floor?
- Getting setup and holding costs right
- What competing calculators miss
- Frequently asked questions
- Add This Calculator to Your Website
- References
How to use the optimal batch size calculator
Five inputs drive the answer, two are optional, and the results stay hidden until you click Calculate. The worked example (10,000 units, $500 setup, $2 holding) is pre-filled so you can run it first and check the arithmetic below.
- Enter annual demand in units. Use a realistic full year. The model assumes demand arrives at a roughly steady rate, so a single strong month scaled up by twelve will flatter the answer.
- Enter the setup cost per batch in dollars. This is the fixed cost of starting one production run: changeover labor, calibration, first-article inspection, downtime. It is charged once per batch, never per unit.
- Choose how holding cost is quoted. Leave the dropdown on dollars per unit per year if you know the figure directly. Switch it to percent of unit cost if your accountant quotes a carrying charge: the tool multiplies the rate by your unit cost, so 25 percent of $8 becomes $2 per unit per year. The unit cost you enter is used only for that conversion.
- Optionally enter your production rate to enable EBQ. Leave it blank for bought-in stock and the tool uses EOQ, which assumes the whole batch arrives at once. Enter your own line speed, in units per year on the same annual basis as demand, and the tool applies the finite-production-rate correction. The rate must be above annual demand (see the FAQ on what happens when it is not).
- Optionally add lead time and working days for a reorder point. Lead time is the days between starting a batch and having finished units. Working days defaults to 250. With both entered, the tool adds a reorder point line: the stock level that should trigger the next batch.
- Click Calculate and read the cost split. The headline is the batch size in whole units. Below it, the annual setup and holding totals tell you whether you are anywhere near the optimum: at the true optimum they are equal.
The optimal batch size formula: EOQ and EBQ
Both models minimize the same total: annual setup cost plus annual holding cost. The setup side falls as batches get bigger (fewer batches a year), the holding side rises (more stock sitting around), and the optimum sits where the two are equal. The derivation, setting the derivative of total cost to zero, is the standard textbook treatment in operations management.
EBQ: Q* = √( (2 × D × S ÷ H) × (P ÷ (P − D)) )
Annual setup cost = (D ÷ Q) × S | Annual holding cost (EOQ) = (Q ÷ 2) × H
Annual holding cost (EBQ) = (Q ÷ 2) × (1 − D ÷ P) × H | Batches per year = D ÷ Q | Cycle time = Q ÷ D × 365 days
D is annual demand, S is setup cost per batch, H is holding cost per unit per year, and P is the production rate. The EBQ version is the EOQ formula multiplied by the production factor P ÷ (P − D), which is always above 1: because stock builds up gradually while your own line runs, average inventory is lower than the EOQ picture assumes, so the cheapest batch is larger. The open textbook Fundamentals of Operations Management presents this finite-production-rate extension with the same (1 − d/p) adjustment and works it through a full example in its chapter on the economic production quantity model, and the batch-quantity formula with the same structure is set out with a worked example at Accounting Simplified.
Worked example: the pre-filled numbers, checked by hand
The calculator opens with annual demand 10,000, setup $500 and holding $2. Running it gives 2,236 units, and the hand check is short: 2 × 10,000 × 500 ÷ 2 = 5,000,000, and √5,000,000 = 2,236.07, rounded to 2,236 units. Batches per year are 10,000 ÷ 2,236.07 = 4.47, and the cycle is 2,236.07 ÷ 10,000 × 365 = 81.62 days. Annual setup is 4.47 × $500 = $2,236.07 and annual holding is (2,236.07 ÷ 2) × $2 = $2,236.07, for $4,472.14 total. The reorder point is 10,000 ÷ 250 × 10 = 400 units. Every figure matches the tool exactly.
The table below runs the same factory two ways: bought-in stock (EOQ, no production rate) and made in-house at 120,000 units a year (EBQ). Same demand, same costs, two different answers, and the in-house row is $4,724.75 a year cheaper.
| Scenario (D=50,000, S=$1,000, H=$4) | Optimal batch | Batches/yr | Annual setup | Annual holding | Total/yr |
|---|---|---|---|---|---|
| Bought-in stock (EOQ) | 5,000 | 10.00 | $10,000.00 | $10,000.00 | $20,000.00 |
| Made in-house, P=120,000 (EBQ) | 6,547 | 7.64 | $7,637.63 | $7,637.63 | $15,275.25 |
Both rows are real runs of this calculator. The EBQ row is not a rounding artifact of the EOQ row: 6,547 comes from √((2 × 50,000 × 1,000 ÷ 4) × (120,000 ÷ 70,000)) = √42,857,143 = 6,546.5, rounded up. The setup and holding columns are equal inside each row, which is the signature of a genuine optimum, and the gap between the rows is the annual price of using the wrong model for an in-house line.
EOQ vs EBQ: which model fits your floor?
Use EOQ when you buy the item and it arrives in one delivery. Use EBQ when you make it and the line feeds stock gradually while demand keeps drawing it down. The calculator picks between them from a single input: leave the production rate blank and you get EOQ, enter a rate above demand and you get EBQ.
| Question | EOQ (instant replenishment) | EBQ (finite production rate) |
|---|---|---|
| Right for | Purchased parts, resale goods, anything delivered whole | Anything you manufacture yourself on your own equipment |
| Inventory picture | Full batch lands at once, then drains to zero | Stock builds at (P − D) while the line runs, then drains |
| Average inventory | Q ÷ 2 | (Q ÷ 2) × (1 − D ÷ P), always smaller |
| Batch size | Smaller, because the model assumes the worst-case stock | Larger, by the production factor P ÷ (P − D) |
| Breaks when | Demand is lumpy or lead times are long and variable | Production rate is at or below demand; the tool then falls back to EOQ |
If you run the finite-rate case often, the dedicated EPQ calculator goes further: it adds maximum inventory level, a storage-capacity check and a savings comparison against the batch size you run today, while this page stays the faster two-model tool with the reorder point.
Getting setup and holding costs right
The formula is exact; the inputs are where batch sizing usually goes wrong. Setup cost is the easier of the two to pin down: add up changeover labor, calibration and inspection time, the value of the downtime while the line is not producing, and any tooling or cleaning cost per run. These are operating costs of the production function, so the same discipline that goes into an operating cost breakdown applies here: list every cost once, and resist the urge to fold per-unit material cost into a per-batch figure, because material cost does not change with batch size and drops out of the optimization entirely.
Holding cost is the harder one, and it has four pieces: warehouse space and handling, insurance and taxes, spoilage or obsolescence risk, and the return the tied-up cash could have earned elsewhere. That last piece is an opportunity cost in the strict sense: cash sitting in finished goods is cash not earning its cost of capital. Most firms land between 20 and 30 percent of unit cost per year once all four are added, which is why the calculator accepts the rate directly.
Cost-input checklist
- Setup cost: labor, calibration, inspection, downtime value, tooling. One total per batch.
- Holding cost: space, insurance, obsolescence risk, cost of capital. One total per unit per year, or a percent of unit cost.
- Never include: per-unit material or purchase cost (batch-size independent), sunk equipment cost, allocated overhead that would not change if batches doubled.
- Re-run the calculation whenever any of the three inputs moves materially. Batch sizes set from last year's costs are the most common way good EOQ math produces bad batches.
What competing calculators miss
Batch-size tools fall into two camps, and the split is the gap this page was built to close:
- EOQ-only calculators (BraveCalculator's optimal batch size page): three inputs, one worked example, correct arithmetic, but no production-rate mode at all. An in-house manufacturer gets the bought-in answer, understated by the production factor. No holding-as-percent mode, no reorder point, no annual cost split to audit the result.
- Name-only batch tools (BraveCalculator's economic batch size page): calls itself a batch-size calculator but computes √(2DS/H), the plain EOQ formula with no finite-rate correction. The name promises EBQ; the math does not deliver it.
- Textbook example pages (IndiaFreenotes' EBQ notes): one worked example computes EBQ as √(2 × 24,000 × 800 ÷ 4) with no production-capacity factor, which is EOQ wearing EBQ's clothes. The capacity term is the entire difference between the two models.
- Formula references (Accounting Simplified): a clean statement of the EBQ formula with the (1 − D/P) denominator, but no interactive tool and no cost breakdown.
- The gap this page fills: both models in one tool with the model named in the output, holding cost accepted the way accountants quote it, the full annual setup-versus-holding split so the optimum can be checked by its signature equality, and a reorder point from lead time and working days.
Frequently asked questions
They are the same calculation in different clothes. EOQ, the economic order quantity, is the classic name from purchasing: the order size that minimizes ordering plus holding costs. Optimal batch size is the manufacturing name for the same trade-off, with setup cost standing in for ordering cost. This calculator reports both names and picks the model from your inputs.
Use EBQ whenever you manufacture the item yourself at a finite production rate. EOQ assumes the whole batch arrives instantly; on your own line, stock builds gradually at (P minus D) while demand keeps drawing it down, so average inventory is lower and the cheapest batch is larger. Enter your production rate and the calculator applies the correction automatically.
Switch the holding-cost dropdown to percent of unit cost and enter the carrying-charge rate your accountant uses, typically 20 to 30 percent per year, plus your unit cost. The calculator converts it: 25 percent of an $8 unit becomes $2 per unit per year. The unit cost is used only for that conversion and does not enter the batch formula anywhere else.
It is a property of the math, not a coincidence. Total cost is (D/Q)S + (Q/2)H, and setting its derivative to zero gives Q* = sqrt(2DS/H). At that Q*, the two terms are equal by construction. Use it as an audit: if your results show $10,000 of setup against $2,000 of holding, your batch size is too small and the model is telling you so.
The EBQ formula needs P greater than D; at or below demand the production factor P/(P-D) is zero or negative and the model breaks. This calculator falls back to plain EOQ in that case and labels the model accordingly. Treat the fallback as a warning, not an answer: a line that cannot outproduce demand will stock out, and no batch-size formula fixes a capacity shortfall.
The reorder point is daily usage times lead time, and daily usage is annual demand divided by the days you actually produce and ship. Dividing by 365 instead of your 250 working days would understate daily usage and set the reorder point too low. The tool rounds the result up, since you cannot reorder a fraction of a unit.
The calculator accepts zero, but read the result carefully: with no setup cost the formula returns a batch size of 0 units, infinite batches per year, and not-a-number cost lines, because the math says to produce continuously in infinitesimal batches. In practice a zero setup cost means the EOQ/EBQ framing no longer applies; the constraint becomes capacity or changeover time rather than cost.
Same finite-rate mathematics, different job. The EPQ calculator is the deep tool for the in-house case: maximum inventory level, a storage-capacity check, and a savings comparison against the batch size you run today. This page is the faster two-model tool: EOQ or EBQ from one input set, the annual cost split, and a reorder point.
Add This Calculator to Your Website
Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.
Powered by Calculator Zilo
References
- Abbas, A. and Goosheh, S. Inventory Models for Certain Demand: Economic Production Quantity (EPQ), Fundamentals of Operations Management (2024), eCampusOntario. Accessed October 23, 2026.
- Accounting Simplified. Economic Batch Quantity (EBQ): Formula and Worked Example. Accessed October 23, 2026.
- MYOB. Understanding Economic Order Quantity (With Calculation). Accessed October 23, 2026.
- Fiveable. Economic Order Quantity (EOQ): Key Term, Intro to Business. Accessed October 23, 2026.
- SlideToDoc. Advanced Management Accounting: Inventory Management, Economic Order Quantity (operations lecture slides). Accessed October 23, 2026.
