Manufacturing · Inventory

EPQ Calculator & Formula

Find the optimal production lot size for items you manufacture in-house. Unlike EOQ, the Economic Production Quantity accounts for your production rate — so you stop over- or under-batching.

Inputs & Results
Full EPQ formula · finite production rate
Daily demand d = 480 units/day
Enter your values and press Calculate EPQ to see the optimal lot size and full cost breakdown.

Method — full Economic Production Quantity model: finite production rate (requires p > d), constant demand, and no stockouts. Daily demand d = annual demand D ÷ working days.

What is Economic Production Quantity?

Economic Production Quantity (EPQ) is the production lot size that minimizes the total of setup cost and inventory holding cost when you manufacture an item yourself. It is the production-side counterpart of the Economic Order Quantity (EOQ).

The key difference: EOQ assumes a full order arrives instantly in one delivery, so peak inventory equals the whole order. EPQ assumes you build units gradually at a finite production rate while you are also consuming them — so inventory builds up slowly and peaks below the full lot. That lowers average holding cost and pushes the optimal lot size higher than EOQ.

The EPQ formula

EPQ = √( (2 × D × S) / ( H × (1 − d/p) ) ) D = annual demand (units/year)  ·  S = setup cost per run ($)  ·  H = holding cost per unit per year ($)
d = daily demand rate  ·  p = daily production rate  ·  requires p > d
The term (1 − d/p) is what separates EPQ from EOQ. As your production rate p gets very large relative to demand d, this term approaches 1 and EPQ collapses back to EOQ — because instant production is the same as instant delivery.

The variables, and where each number comes from

SymbolMeaningUnitWhere you get it
DAnnual demandunits / yearSales forecast or last 12 months of shipments for the item
SSetup cost per runcurrency / runChangeover labour + scrapped first-off parts + machine time lost to the changeover
HHolding cost per unit per yearcurrency / unit / yearCost of capital + storage + insurance + obsolescence, as an annual rate on one unit
pDaily production rateunits / dayGood units this line produces in one working day when running this item
dDaily demand rateunits / dayDerived, not entered: d = D ÷ working days per year

The model requires p > d. If your line cannot out-produce demand on the days it runs, no lot size fixes that — it is a capacity problem, and the calculator will tell you so instead of returning a number.

EPQ formula worked example

A plant makes one gearbox variant in-house. Annual demand is 12,000 units over 250 working days, a changeover costs 450 per run, holding one unit for a year costs 3.20, and the line produces 200 good units per day.

InputValue
Annual demand D12,000 units / year
Setup cost per run S450 per run
Holding cost H3.20 per unit per year
Production rate p200 units / day
Working days per year250

Step 1 — get the daily demand rate. The formula needs d in the same time unit as p:
d = D ÷ working days = 12,000 ÷ 250 = 48 units / day

Step 2 — evaluate the production-rate term. This is the part EOQ does not have:
1 − d/p = 1 − 48/200 = 1 − 0.24 = 0.76

Step 3 — substitute into the EPQ formula.
EPQ = √( (2 × 12,000 × 450) ÷ (3.20 × 0.76) )
EPQ = √( 10,800,000 ÷ 2.432 )
EPQ = √4,440,789 = 2,107 units per run

Step 4 — read off the scheduling numbers. The lot size alone does not tell you when to run:

ResultValueHow it is derived
Optimal lot size (EPQ)2,107 unitsthe formula above
Peak inventory1,602 unitsEPQ × (1 − d/p) = 2,107 × 0.76
Runs per year5.7D ÷ EPQ = 12,000 ÷ 2,107
Run time per batch10.5 daysEPQ ÷ p = 2,107 ÷ 200
Cycle length between runs43.9 daysEPQ ÷ d = 2,107 ÷ 48
Total annual cost at the optimum5,125√(2 × D × S × H × (1 − d/p))
Cost per unit0.427total annual cost ÷ D

Step 5 — compare against EOQ to see what the production rate bought you. Ignoring the finite production rate gives EOQ = √(2 × 12,000 × 450 ÷ 3.20) = 1,837 units. So EPQ is 14.7% larger than EOQ here, and because inventory peaks at 1,602 instead of the full lot, holding cost drops by about 377 per year. Batch to the EOQ number and you change over 6.5 times a year instead of 5.7 — paying for roughly one extra setup you did not need.

Every figure above is what this calculator returns for those inputs. Press Load a worked example in the calculator to run them yourself and see the cost curve.

Where the EPQ formula comes from (derivation)

The formula is not arbitrary — it is the minimum of a total-cost curve. Two costs pull in opposite directions as the lot size Q changes, and EPQ is the lot size where their sum is smallest.

1. Total annual cost as a function of lot size

Bigger lots mean fewer setups per year, so setup cost falls as Q rises. Bigger lots also mean more stock sitting around, so holding cost climbs as Q rises:

TC(Q) = (D/Q) × S  +  (Q/2) × (1 − d/p) × H left term = annual setup cost  ·  right term = annual holding cost

The D/Q in the first term is simply how many runs you make per year. The second term is average inventory multiplied by the holding rate — and that is where the production rate enters.

2. Why average inventory is Q/2 × (1 − d/p), not Q/2

Under EOQ a full order lands at once, so stock jumps to Q and then drains to zero: average inventory is Q/2. Under EPQ you are producing and consuming at the same time. During the run, stock grows at only (pd) per day rather than jumping, so it never reaches Q — it tops out at Q × (1 − d/p). Halve that peak and you get average inventory. This single change is the whole difference between the two models.

3. Setting the derivative to zero

TC(Q) is a convex curve, so its minimum is where the slope is flat. Differentiating with respect to Q:

dTC/dQ = −DS/Q²  +  H(1 − d/p)/2 = 0

Rearranging for Q gives Q² = 2DS / (H(1 − d/p)), and taking the square root returns the EPQ formula. A useful consequence falls out of the same equation: at the optimum the two cost terms are equal. In the example above, annual setup cost and annual holding cost are each about 2,562 — half of the 5,125 total. That is a quick sanity check on any lot size you are handed.

4. What the model assumes

Real shop floors violate at least one of these. Treat EPQ as the starting point that setup and holding economics justify, then adjust for capacity, shelf life, and pallet or container sizes.

EOQ vs EPQ side by side

 EOQEPQ
SituationYou buy the itemYou manufacture the item
How stock arrivesWhole order at onceGradually, during the production run
Peak inventoryQQ × (1 − d/p)
Average inventoryQ / 2Q/2 × (1 − d/p)
Formula√(2DS / H)√(2DS / (H(1 − d/p)))
Resulting lot sizeSmallerLarger
Example above1,837 units2,107 units

EOQ is the special case of EPQ where production is instant. Push p far above d and (1 − d/p) approaches 1, at which point the two formulas are identical.

Why it matters on the shop floor

Using EOQ when you actually produce in-house systematically under-sizes your runs. You end up changing over more often than necessary, burning setup time and capacity. EPQ also tells you the run time per batch and the cycle length between runs — the numbers you need to schedule production, not just size it.

Frequently asked questions

What is the Economic Production Quantity (EPQ)?
EPQ is the optimal production lot size that minimizes combined setup and holding cost when a company produces inventory in-house at a finite rate, rather than receiving a full order at once.
How is EPQ different from EOQ?
EOQ assumes inventory arrives instantly in one delivery, so peak inventory equals the whole order. EPQ assumes you produce units gradually while also consuming them, so peak inventory stays below the full lot. This makes EPQ larger than EOQ and lowers average holding cost.
What is the EPQ formula?
EPQ = √((2 × D × S) / (H × (1 − d/p))), where D is annual demand, S is setup cost per run, H is annual holding cost per unit, d is the daily demand rate, and p is the daily production rate. The model requires p > d.
When should I use EPQ instead of EOQ?
Use EPQ when you manufacture the item yourself and production happens over time at a finite rate. Use EOQ when you purchase the item and receive the full order in a single delivery.
How do you derive the EPQ formula?
Write total annual cost as TC(Q) = (D/Q)S + (Q/2)(1 − d/p)H, where the first term is setup cost and the second is holding cost on the reduced average inventory. Differentiate with respect to Q, set dTC/dQ = −DS/Q² + H(1 − d/p)/2 = 0, and solve: Q² = 2DS / (H(1 − d/p)). The square root of that is EPQ. At the optimum the annual setup and holding costs are equal.
Why does the EPQ formula include (1 − d/p)?
Because you consume units while you are still producing them. Inventory grows at only (p − d) per day during a run instead of arriving all at once, so it peaks at Q × (1 − d/p) rather than Q. That lower average inventory reduces holding cost, which makes the optimal lot size larger than EOQ. If p is far greater than d, the term approaches 1 and EPQ becomes EOQ.
What does EPQ assume?
Steady known demand, a production rate greater than the demand rate, a fixed setup cost per run independent of lot size, holding cost that is linear in average inventory, a single item without shared-capacity competition, and no quantity discounts or stockouts. Most real shop floors break at least one assumption, so treat EPQ as an economics-justified starting point and then adjust for capacity, shelf life, and pallet sizes.
Can EPQ be smaller than EOQ?
No. Since 0 < (1 − d/p) < 1 whenever p > d, dividing by it makes the value under the square root larger, so EPQ is always greater than or equal to EOQ for the same D, S and H. It equals EOQ only in the limit of instant production.

Put this calculator on your site — free

Teaching operations, writing about inventory, or building an internal wiki? Embed the live EPQ calculator in one paste. No signup, no cost — it keeps working on your page and links back here.

Live preview
Copy this HTML

Paste anywhere in your page's HTML. The calculator runs in a sandboxed frame — it won't touch the rest of your site.