Economic Production Quantity (EPQ) Calculator
- The economic production quantity adapts the EOQ model to a line that produces at 200 units a day while demand drains stock at 50 a day, so inventory builds at only 150 units a day during a run instead of arriving all at once.
- EPQ = sqrt(2 D S / H x p / (p - d)) = sqrt(2 x 12,000 x 150 / 3 x 200 / 150) = 1,265 units per run.
- Stock peaks at Q x (1 - d/p) = 949 units, not the full run size, because 50 units a day ship while the line is still producing. A production run lasts 6.3 days and the cycle repeats every 25.3 days.
- At the optimum the annual setup cost $1,423.02 and the annual holding cost $1,423.02 are equal, totalling $2,846.05 a year - the signature check of the economic production quantity model.
This economic production quantity calculator finds the run size that minimizes the combined cost of setting up production and holding inventory. It is built for operations where you make the item yourself rather than buy it in, so stock builds up gradually while demand keeps drawing it down. In the worked example, making 12,000 units a year with a $150 setup cost, a $3.00 holding cost, and production running at 200 units a day against demand of 50 a day, the EPQ is 1,265 units per run. Inventory peaks at 949 units, not the full run, because demand keeps consuming while production runs. Total relevant cost at that optimum is $2,846.05 per year, split evenly between setup and holding, over 9.49 runs.
This is the standard method for the problem because EPQ extends EOQ with a finite production rate: Q* = sqrt( 2 D S / (H (1 - d/p)) ). The logic is well established. As the production rate grows toward infinity, EPQ converges to the classic EOQ, since instant replenishment is the limiting case. The model also has a hard boundary: the production rate must exceed the demand rate, or inventory can never accumulate and the model breaks. This page shows the formula, step-by-step workings, worked examples and sources so you can check every number yourself rather than take the result on trust.
Worked examples
Machined part
(12000 units · 150 $ · 3 $ · 200 units/day · 50 units/day)
| Economic production quantity | 1,265 units |
| Maximum inventory level | 949 units |
| Total relevant cost per year | $2,846.05 |
| Production runs per year | 9.49 |
Packaged goods
(5000 units · 80 $ · 2.5 $ · 100 units/day · 20 units/day)
| Economic production quantity | 632 units |
| Maximum inventory level | 506 units |
| Total relevant cost per year | $1,264.91 |
| Production runs per year | 7.91 |
High volume
(26000 units · 300 $ · 5 $ · 400 units/day · 100 units/day)
| Economic production quantity | 2,040 units |
| Maximum inventory level | 1,530 units |
| Total relevant cost per year | $7,648.53 |
| Production runs per year | 12.75 |
The EPQ formula and the (1 - d/p) term
The economic production quantity calculator rests on a single correction to the familiar EOQ model. When a supplier delivers a batch all at once, every unit arrives on the same day and inventory jumps straight to the order quantity. When you produce the batch yourself, units arrive gradually while customers keep buying. The EPQ formula accounts for that overlap: Q* = sqrt( 2 D S / (H (1 - d/p)) ), where D is annual demand, S is the setup cost per run, H is the holding cost per unit per year, d is the demand rate, and p is the production rate.
The term (1 - d/p) is the fraction of each production day that actually adds to stock. If you make 200 units a day and ship 50 a day, 150 units a day stay in inventory, so the factor is 1 - 50/200 = 0.75. Dividing by 0.75 in the denominator is the same as multiplying the EOQ result by 1/sqrt(0.75), about 1.155, which raises the optimal run size. The reason is that each unit spends less time in storage than it would under instant replenishment, so holding costs per unit are effectively lower and larger runs become economical. This is also why the model requires the production rate to exceed the demand rate: if p were at or below d, the factor would be zero or negative, inventory could never accumulate, and the formula would break down.
Work the example. Annual demand is 12,000 units, setup cost is $150, holding cost is $3.00 per unit per year, production runs at 200 units a day and demand is 50 a day. The correction factor is 1 - 50/200 = 0.75, so the denominator becomes $3.00 x 0.75 = $2.25. Then Q* = sqrt( 2 x 12,000 x 150 / 2.25 ) = sqrt( 3,600,000 / 2.25 ) = sqrt( 1,600,000 ), which gives 1,265 units per run. Note what that run size does not mean: inventory does not peak at 1,265. Because demand keeps consuming while production runs, the peak is 1,265 x 0.75 = 949 units. The remaining 316 units are sold before they ever sit in stock.
At that optimum the total relevant cost is $2,846.05 per year, split evenly between setup and holding, across 9.49 runs. The even split is the signature of an optimum in this family of models, and it holds here just as it does in EOQ. The correction factor also explains the relationship between the two models: as the production rate grows toward infinity, d/p shrinks toward zero, the factor approaches 1, and EPQ converges to the classic EOQ. Instant replenishment is simply the limiting case of a very fast production line.
Maximum inventory is not the batch size
A common mistake when reading an economic production quantity calculator is to treat the run size as the amount sitting in the warehouse. In the worked example on this page, the EPQ is 1,265 units per run, yet inventory never reaches 1,265. It peaks at 949 units. The gap is not an error or a rounding artifact — it is the whole point of the EPQ model, and it is why the calculator's holding-cost line is smaller than a naive reading of the batch size would suggest.
The reason is that the plant keeps selling while it makes. Production runs at 200 units a day, demand pulls 50 units a day, so stock rises by a net 150 units a day during the run. The run itself lasts about 6.3 days, and 150 units a day over that span builds to the 949-unit peak. Once the run ends, the plant stops making and inventory drains at the full 50 units a day until the next setup. Plotted over a year, the pattern is a sawtooth with sloped sides on both the climb and the fall — gradual build-up, gradual drawdown — rather than the vertical jump to full batch size you would see under instant replenishment.
That shape is why holding cost uses the peak, and only half of it on average. Inventory spends the cycle moving between zero and 949 units, so the average level carried is half the peak. Charging holding cost against the full 1,265-unit run would overstate what is actually stored. The same logic explains the other number worth noticing: with a $150 setup cost, a $3.00 holding cost, 12,000 units of annual demand and production at 200 units a day against demand of 50 a day, total relevant cost at the optimum is $2,846.05 per year, split evenly between setup and holding, spread over 9.49 runs. That even split is the signature of a correct EPQ answer — if your setup and holding totals are far apart, something in the inputs or the interpretation is off.
The formula makes the adjustment explicit. EPQ extends EOQ with a finite production rate: Q* = sqrt( 2 D S / (H (1 - d/p)) ), where d is demand per period and p is production per period. The term (1 - d/p) shrinks the denominator, which raises the optimal batch — you run longer because each run leaves a smaller peak than its size implies. As the production rate grows toward infinity, EPQ converges to the classic EOQ, since instant replenishment is simply the limiting case. One condition is non-negotiable: the production rate must exceed the demand rate. If it does not, inventory can never accumulate and the model breaks.
EPQ versus EOQ
The economic production quantity calculator answers a question that the classic economic order quantity (EOQ) model cannot: what lot size makes sense when you make the item yourself rather than buy it in ready-made batches? EOQ assumes a purchased lot arrives all at once, so inventory jumps instantly from zero to the full order quantity. EPQ assumes a production run that fills stock gradually while demand keeps drawing it down. That single difference changes both the formula and the answer. EPQ extends EOQ with a finite production rate: Q* = sqrt( 2 D S / (H (1 - d/p)) ), where d is the daily demand rate and p is the daily production rate.
A worked example shows how the pieces fit. Suppose a shop makes 12,000 units a year, with a $150 setup cost and a $3.00 holding cost per unit per year, and production runs at 200 units a day against demand of 50 a day. The EPQ is 1,265 units per run. Inventory does not peak at 1,265, though. Because demand consumes 50 units a day while the line produces 200, stock builds at only 150 units a day, and it peaks at 949 units, not the full run. Total relevant cost at the optimum is $2,846.05 per year, split evenly between setup and holding, over 9.49 runs.
That even split is the signature of an optimum in this family of models, and it is the same balance EOQ strikes between ordering and holding. What differs is the denominator term (1 - d/p), which shrinks as the production rate rises relative to demand. As p grows toward infinity, the term approaches 1, the formula collapses back to the classic EOQ, and EPQ converges to EOQ. Instant replenishment is simply the limiting case of a very fast production line. Run the numbers through an economic production quantity calculator and you can watch the lot size fall as p climbs, approaching the EOQ value from above.
One condition is non-negotiable: the production rate must exceed the demand rate. If p is at or below d, inventory can never accumulate, the denominator goes to zero or negative, and the model breaks. In practice, a line that cannot outproduce demand needs capacity added or the item purchased instead, which puts you back in EOQ territory.
- EOQ: purchased lots arrive all at once; inventory jumps to the full order quantity.
- EPQ: a production run replenishes gradually while demand consumes stock, so the peak is below the run size.
- As the production rate rises toward infinity, EPQ converges to EOQ, the instant-replenishment limiting case.
- The production rate must exceed demand, or inventory can never build and the model fails.
Cost balance at the optimum
At the EPQ, the two costs the model cares about meet in the middle. In the worked example — 12,000 units of annual demand, a $150 setup cost, a $3.00 holding cost per unit per year, production at 200 units a day against demand of 50 a day — the economic production quantity calculator returns a run size of 1,265 units. Total relevant cost at that run size is $2,846.05 per year, and it splits evenly: roughly $1,423 for setups and roughly $1,423 for holding. That even split is not a coincidence. It is the signature of the optimum in the EPQ model.
The reason the split comes out even is that the two costs move in opposite directions as the run size changes. Run bigger batches and you order less often, so setup cost falls — but average inventory rises, so holding cost climbs. Run smaller batches and the reverse happens. The optimum sits where the savings from one more unit of run size exactly cancel the extra cost of carrying it, which is the point where the two totals are equal. The 9.49 runs per year in the example is simply 12,000 divided by 1,265, and it is the frequency at which that balance holds.
What makes the result practical is that the cost curve is flat near the bottom. Suppose you rounded the run size to something convenient, or your real setup cost drifted a little from $150. The total would not jump to some alarming figure; it would creep up only slightly, because you are still close to the minimum of a shallow bowl. The penalty for being a bit off the theoretical EPQ is small, while the penalty for being far off — very large batches or very small ones — grows quickly. That is why the even $1,423/$1,423 split at $2,846.05 is best read as a target to aim near, not a number that must be hit exactly.
One structural point explains why the EPQ differs from the simpler EOQ. Because production is not instantaneous, inventory builds only at the net rate of production minus demand. In the example, that means the peak is 949 units, not the full 1,265-unit run, since demand keeps consuming output while the run is underway. The formula captures this with the factor (1 - d/p): Q* = sqrt( 2 D S / (H (1 - d/p)) ). As the production rate p grows toward infinity, that factor approaches 1 and the EPQ converges to the classic EOQ — instant replenishment is just the limiting case.
The model also has a hard requirement: the production rate must exceed the demand rate. If it does not, inventory can never accumulate and the formula breaks down. In this example, 200 units a day against 50 a day leaves plenty of headroom, which is why the run builds a healthy peak before demand draws it down.
FAQs
What is the EPQ formula?
The economic production quantity is Q* = sqrt( 2 D S / (H (1 - d/p)) ), where D is annual demand, S is setup cost per run, H is holding cost per unit per year, d is demand rate and p is production rate. In the worked example, the formula gives a batch size of 1,265 units.
How is EPQ different from EOQ?
EPQ assumes stock arrives gradually at a finite production rate while demand continues during the run. EOQ assumes the whole lot arrives at once. Because the EPQ model accounts for output arriving piece by piece, it usually calls for a larger batch than EOQ would for the same demand, setup and holding cost inputs.
What is the maximum inventory in the example?
Maximum inventory in the example is 949 units. Demand consumes a quarter of output during each run, so stock peaks below the 1,265-unit batch. The gap between the batch size and the peak reflects the units sold while production is still underway, which is why the maximum on hand never reaches the full quantity produced.
How many production runs per year is that?
The example works out to 9.49 production runs per year, with a total relevant cost of $2,846.05 per year. That cost combines setup costs and holding costs at the 1,265-unit batch size, so it represents the annual expense of ordering and carrying inventory under the EPQ plan.
What if production is slower than demand?
The model breaks down. If the production rate does not exceed the demand rate, inventory can never build, so the production rate must exceed the demand rate. When output cannot outpace consumption, stock is drawn down as fast as it is made, and the EPQ formula no longer produces a meaningful batch size.
How sensitive is cost to the batch size?
The total cost curve is flat near the optimum, so rounding 1,265 to a convenient run size costs very little. Small deviations from the calculated batch size barely change total relevant cost, which gives you room to pick practical run quantities without giving up much savings.