The True Cost of a Stockout (and How to Stop Overselling)
A stockout does not cost you one sale. It costs the margin on that sale, sometimes the customer for good, a dent in your marketplace ranking, a rush-freight bill to recover, and hours of staff firefighting. This guide breaks the full cost down into five parts, gives you a simple £ framework to estimate it for your own business, separates a true stockout from a phantom-stock oversell, and lays out the operational fixes.
The cost of stockouts is the total money a business loses when it cannot supply demand from stock: the contribution margin on sales that walk away, the extra cost of backorders that wait, the expediting spent to recover, and the future margin of customers who do not come back. It is rarely the selling price of the missed order, and it is rarely zero.
The practical problem is that none of these costs appears as a line in a sales report. An order that never happened leaves no invoice, so stockouts get treated as bad luck rather than as a priced decision. This guide defines each component, works through a hypothetical incident with the arithmetic shown, builds a small model in Python and then uses the result to choose a service level per line.

An empty shelf costs more than the price on the ticket. Illustrative photograph, not an OpsMavix project.
Image credit: Roy Broo, Pexels Licence. No edits.
Key Takeaways
- Stockout cost is measured in lost contribution margin and extra cost, never in lost revenue.
- Split it into costs per unit short (lost margin, backorders, customer loss) and costs per stockout event (expediting, firefighting).
- Estimate the share of short demand that is lost rather than delayed, line by line.
- Customer loss is often the largest component, so keep its inputs conservative and documented.
- A priced stockout lets you compare buffer holding cost with shortage cost and pick a service level per line.
- Lines with expensive stockouts justify higher service levels; cheap stockouts justify lower ones.
In this guide:
- 1. Define the Cost of a Stockout
- 2. Calculate Lost Margin Correctly
- 3. Price Backorders and Split Shipments
- 4. Count Expediting and Firefighting per Event
- 5. Estimate Customer Loss Without Inflating It
- 6. Build a Hypothetical Stockout Cost Model in Python
- 7. Use Stockout Cost to Set Service Levels
- 8. Choose Tools and Keep the Model Current
- Frequently Asked Questions
- How OpsMavix Can Help
1. Define the Cost of a Stockout
A working definition
A stockout happens when demand arrives and there is no available stock to meet it. The cost of that stockout is the difference between what the business earns and spends in that situation and what it would have earned and spent if the stock had been there.
That rules out two mistakes: counting the full selling price, which ignores the cost of goods you avoided, and counting nothing, which ignores customers who do not wait.
Two kinds of cost
Some costs scale with the number of units you could not supply. Others happen once per stockout, however many units were short. Keeping them apart makes the model far more useful later.
| Component | Driver | What it includes | Where the evidence sits |
|---|---|---|---|
| Lost margin | Per unit short | Contribution on demand that goes elsewhere | Sales, cancellations, enquiry logs |
| Backorder cost | Per unit short | Extra parcels, admin, customer contact | Courier invoices, order notes |
| Customer loss | Per unit short | Future margin from customers who defect | Repeat purchase history |
| Expediting | Per event | Rush freight, small emergency orders, supplier surcharges | Purchase orders and freight invoices |
| Firefighting | Per event | Staff time chasing, rescheduling and explaining | Time estimates from the people involved |
True stockout or oversell
A true stockout is an honest zero. An oversell is an order accepted against stock the record showed but the shelf did not hold; the cause is data, not supply. If your stockouts happen while stock is in the building, start with an accurate stock record and the playbook in how to prevent overselling, not a bigger buffer.
2. Calculate Lost Margin Correctly
Use contribution, not revenue
When a sale is lost, you lose the selling price minus the variable costs you would have paid to fulfil it. Those usually include the landed cost of the goods, payment or marketplace fees and pick, pack and postage. If your unit cost leaves out freight and duty, start with landed cost calculation, because an understated cost inflates every margin figure that follows.
Hypothetical example for one line, used throughout this guide:
| Item | Amount |
|---|---|
| Selling price | £30.00 |
| Landed cost | -£14.00 |
| Marketplace or payment fee | -£4.00 |
| Pick, pack and postage | -£2.00 |
| Contribution per unit | £10.00 |
The arithmetic is £30 - £14 - £4 - £2 = £10. A stockout of one unit on this line therefore risks £10 of margin, not £30.
Separate lost demand from delayed demand
Not every short unit is lost. Some customers wait, some accept a substitute and some reorder later. The share that is genuinely lost depends on the product and the customer. An impulse purchase is usually gone; a regular trade customer buying a specified part may well wait.
Estimate a lost share per group of lines from evidence you already hold: cancellations during the outage, backorders later fulfilled versus cancelled, accepted substitutions and back in stock requests.
In the hypothetical example, 60% of short units are lost and 40% are backordered. Lost margin per short unit is therefore 0.6 × £10 = £6.00.
3. Price Backorders and Split Shipments
What a backorder costs
A backorder keeps the sale but adds work. Typical costs include a second parcel when the rest of an order has already gone, extra picking, emails or calls to the customer and the admin of tracking the open line. If you offer a goodwill discount or free upgrade, that is part of the cost too.
Hypothetical worked example
| Cost item | Working | Amount per backordered unit |
|---|---|---|
| Extra parcel and packaging | Hypothetical marginal cost | £1.60 |
| Admin and customer contact | 6 minutes × £24 loaded hourly rate = 0.1 × £24 | £2.40 |
| Backorder cost per unit | £1.60 + £2.40 | £4.00 |
Backorder cost per short unit is then 0.4 × £4.00 = £1.60, because only 40% of short units are backordered in this example. Accurate available to promise dates help keep that cost down.
4. Count Expediting and Firefighting per Event
Expediting and firefighting
Expediting is money spent to shorten the outage: a courier instead of a pallet service, air instead of sea freight, or a small emergency order at a worse unit price. Measure the premium over the normal route, not the whole bill. Firefighting is the staff time spent chasing suppliers, updating listings and answering customers; price it at a loaded hourly rate that includes employment costs.
Hypothetical worked example
| Event cost | Working | Amount per stockout event |
|---|---|---|
| Expedited freight premium | Hypothetical courier premium | £60.00 |
| Firefighting time | 1.5 hours × £24 | £36.00 |
| Cost per stockout event | £60 + £36 | £96.00 |
A checklist for event costs
- List every stockout on the line over the last quarter.
- Attach the expedite premium from each related purchase order or freight invoice.
- Record the staff time spent on each, even roughly.
- Note any supplier surcharges or minimum order penalties on emergency orders.
- Divide the total by the number of events to get an average cost per event.
5. Estimate Customer Loss Without Inflating It

Customer loss is the stockout cost that never appears on the shelf or in a report. Illustrative photograph, not an OpsMavix project.
Image credit: Daniel Andraski, Pexels Licence. No edits.
A conservative formula
A repeat customer who buys elsewhere may not come back, and the loss is the future contribution they would have generated.
Customer loss per short unit = probability the customer defects × remaining contribution from that customer
Use contribution again, not revenue, and use the remaining value over a sensible horizon, not an open-ended lifetime. Base the defection probability on evidence: compare the later purchase behaviour of repeat customers who hit a stockout with similar customers who did not. Where you have no evidence, use a small figure and say so.
In the hypothetical example, each short unit represents one single-unit order from one customer. The defection probability is 5% and the remaining contribution is £120, so customer loss per short unit is 0.05 × £120 = £6.00.
Marketplace consequences
On marketplaces, out of stock listings and seller-cancelled orders can also affect visibility and account health under each marketplace’s own seller performance policies. Those policies change, so check the current version for every channel you sell on rather than relying on a fixed threshold. For a priced example of oversell costs across channels, see the cost of overselling across channels, and for channel-level buffers see safety buffers per channel.
Hypothetical incident total
Assume one stockout event in which 20 units of demand could not be supplied.
| Component | Working | Cost |
|---|---|---|
| Lost margin | 20 × 60% × £10 = 12 × £10 | £120 |
| Backorder cost | 20 × 40% × £4 = 8 × £4 | £32 |
| Customer loss | 20 × 5% × £120 = 1 × £120 | £120 |
| Expediting and firefighting | 1 event × £96 | £96 |
| Total cost of the stockout | £120 + £32 + £120 + £96 | £368 |
Per short unit, the three unit-based components add up to £6.00 + £1.60 + £6.00 = £13.60, and 20 × £13.60 = £272. Adding the £96 event cost gives £368. The naive figure of 20 × £30 = £600 of lost revenue overstates the immediate loss, while a figure of zero would ignore £368 of real cost.
6. Build a Hypothetical Stockout Cost Model in Python
What the model compares
Safety stock reduces stockouts but costs money to hold. The model below compares, for each possible cycle service level, the annual holding cost of the safety stock with the annual expected cost of stockout events and short units. It assumes continuous review, a fixed order quantity, normally distributed demand over the lead time and an annual holding cost per unit. All inputs are hypothetical.
It uses Python’s built-in statistics.NormalDist, so no extra libraries are needed.
from statistics import NormalDist
N = NormalDist() # hypothetical inputs below
margin = 30.0 - 14.0 - 4.0 - 2.0 # £10 contribution per unit
lost_share = 0.60 # share of short units lost
backorder_cost = 4.00 # £ per backordered unit
defect_prob, remaining_value = 0.05, 120.0
cost_per_unit_short = (lost_share * margin
+ (1 - lost_share) * backorder_cost
+ defect_prob * remaining_value) # £13.60
cost_per_event = 60.0 + 1.5 * 24.0 # £96 expedite + firefighting
annual_demand = 5200 # units a year
order_qty = 400 # units per order
sigma_ltd = 60.0 # std dev of lead time demand
holding = 0.25 * 14.0 # £3.50 per unit per year
def annual_cost(csl):
k = N.inv_cdf(csl) # safety factor
safety_stock = k * sigma_ltd
loss_fn = N.pdf(k) - k * (1 - N.cdf(k)) # standard loss function
short_per_cycle = sigma_ltd * loss_fn # expected units short
cycles = annual_demand / order_qty # 13 orders a year
hold = holding * safety_stock
events = cycles * (1 - csl) * cost_per_event
units = cycles * short_per_cycle * cost_per_unit_short
fill_rate = 1 - short_per_cycle / order_qty
return safety_stock, hold, events, units, hold + events + units, fill_rate
for csl in (0.90, 0.95, 0.975, 0.98, 0.99, 0.995):
ss, hold, events, units, total, fill = annual_cost(csl)
print(f"{csl:.1%} SS {ss:6.1f} hold £{hold:6.0f} "
f"events £{events:4.0f} short £{units:5.0f} "
f"total £{total:5.0f} fill {fill:.2%}")
Check the arithmetic by hand at 95%
| Step | Working | Result |
|---|---|---|
| Safety factor | NORM.S.INV(0.95) | 1.645 |
| Safety stock | 1.645 × 60 | 98.7 units |
| Holding cost | 98.7 × £3.50 | £345 |
| Event cost | 13 × 5% × £96 = 0.65 × £96 | £62 |
| Expected units short per cycle | 60 × 0.0209 | 1.254 units |
| Unit-short cost | 13 × 1.254 × £13.60 | £222 |
| Total annual cost | £345 + £62 + £222 | £629 |
Figures are rounded to the nearest pound; the model keeps full precision.
7. Use Stockout Cost to Set Service Levels
Read the model output
Running the model for the hypothetical line gives the following annual costs, rounded to the nearest pound.
| Cycle service level | Safety stock | Holding | Stockout events | Units short | Total | Fill rate |
|---|---|---|---|---|---|---|
| 90% | 76.9 | £269 | £125 | £502 | £896 | 99.29% |
| 95% | 98.7 | £345 | £62 | £222 | £629 | 99.69% |
| 97.5% | 117.6 | £412 | £31 | £100 | £543 | 99.86% |
| 98% | 123.2 | £431 | £25 | £78 | £534 | 99.89% |
| 99% | 139.6 | £489 | £12 | £36 | £537 | 99.95% |
| 99.5% | 154.5 | £541 | £6 | £17 | £564 | 99.98% |
Searching every level from 50.0% to 99.9% in steps of 0.1 point, the lowest total in this example is about £531 at a 98.5% cycle service level. Between 97.5% and 99% the total barely moves, so a target anywhere in that band is defensible. Below 95% the cost of shortages climbs quickly; above 99% the extra buffer costs more than the stockouts it prevents.
Compare a line where stockouts are cheap
Now assume a second hypothetical line with the same demand, order quantity and holding cost, but where customers happily wait: only 20% of short units are lost, nobody defects and no expediting is needed. Cost per short unit becomes 0.2 × £10 + 0.8 × £4 = £2.00 + £3.20 = £5.20, and the event cost is £36 of firefighting.
| Line | Cost per unit short | Cost per event | Lowest-cost service level | Annual total at that level |
|---|---|---|---|---|
| A: customers leave, expediting used | £13.60 | £96 | About 98.5% | About £531 |
| B: customers wait, no expediting | £5.20 | £36 | About 95.8% | About £452 |
Same demand, different stockout cost, different service level: the case for per-line targets.
A quick rule of thumb
If you ignore the per-event cost, a common approximation for the cost-minimising probability of a stockout in each cycle is (order quantity × annual holding cost per unit) ÷ (annual demand × cost per unit short).
- Line A: (400 × £3.50) ÷ (5,200 × £13.60) = 1,400 ÷ 70,720 = 0.0198, so a service level of about 98%.
- Line B: (400 × £3.50) ÷ (5,200 × £5.20) = 1,400 ÷ 27,040 = 0.0518, so a service level of about 94.8%.
The full model sets slightly higher targets because it also counts the per-event cost. Use the rule of thumb to sense-check, and the model to decide.
Turn the target into stock
Once the service level is chosen, convert it into safety stock and a reorder point using measured demand and lead time variability. The formulas are in safety stock calculation and how to calculate reorder point. If lead time varies, measure it from your own orders and receipts as described in supplier lead time management.
Limitations to keep in view
- The normal distribution suits steady lines with enough history; lumpy, seasonal or very slow lines need other methods or judgement.
- The cost inputs are estimates. Test how the answer changes if the lost share or defection probability halves or doubles.
- None of this helps if the stock record is wrong. Fix record accuracy before tuning service levels.
8. Choose Tools and Keep the Model Current
Compare the approaches
| Approach | Where it fits | What to check |
|---|---|---|
| Spreadsheet model | A few dozen lines and someone who owns the refresh | Whether demand, margin and lead time data are updated, and who checks the formulas |
| Configure existing inventory or accounting software | The tool already stores reorder levels or safety stock per item | Whether it calculates from history or only stores a number you type in |
| Packaged inventory or planning software | Many lines, standard replenishment and willingness to adopt its process | Supported methods, per-line service levels, data imports and total cost |
| Focused custom application | A clear gap, such as pricing stockouts from your own orders and receipts | Data access, ownership, support and integration with stock records |
| Full ERP, packaged or custom | Wider coordination across purchasing, stock, sales and finance | Scope, migration, implementation effort and ongoing support |
Many packaged systems hold safety stock or minimum levels per item and some offer statistical planning; check the exact edition before assuming a capability. Ask any supplier to run the hypothetical line A above, or better, one of your own lines.
A practical rollout checklist
- Pick the ten lines with the most stockout events last quarter.
- Calculate contribution per unit from landed cost and fees.
- Estimate the lost share and backorder cost from order history.
- Collect expedite premiums and staff time per event.
- Agree a conservative defection probability and remaining value.
- Run the model and choose a service level per line or group.
- Convert each target into safety stock and a reorder point.
- Review actual stockouts and costs against the model after one quarter.
Frequently Asked Questions
What is the cost of stockouts?
It is the money lost when demand cannot be met from stock: lost contribution margin on sales that go elsewhere, extra cost on backorders, expediting and staff time to recover, and future margin from customers who defect.
How do you calculate stockout cost?
Multiply units short by the cost per short unit (lost share × contribution, plus backordered share × backorder cost, plus defection probability × remaining customer contribution), then add the cost per event for expediting and firefighting. In the hypothetical example, 20 × £13.60 + £96 = £368.
Should I use revenue or margin for a lost sale?
Use contribution margin. You did not incur the cost of goods or variable selling costs on a sale you did not make, so revenue overstates the loss.
How does stockout cost affect service level?
The higher the cost of running out relative to the cost of holding a unit, the higher the cost-minimising service level. In the hypothetical comparison, a line with £13.60 per unit short came out at about 98.5%, while a line with £5.20 per unit short came out at about 95.8%.
Is a 99% service level always better?
No. Each extra point needs disproportionately more safety stock. In the hypothetical line A, moving from 98% to 99.5% raises the total annual cost from about £534 to about £564.
What if I do not know the defection probability?
Use a small, documented assumption and test the result at half and double that value. If the chosen service level barely changes, the uncertainty matters little; if it swings, gather better evidence from repeat purchase history.
Do stockouts and oversells cost the same?
No. An oversell adds a cancelled or delayed paid order and is caused by inaccurate stock data, so the fix is record accuracy and channel sync rather than more safety stock.
Can OpsMavix build a stockout cost and service level system?
Yes. OpsMavix can build focused applications or a full custom ERP, and can configure or integrate suitable existing tools where those approaches fit the requirements.
How OpsMavix Can Help
OpsMavix can turn stockout costing into a maintained process: margins taken from real landed costs and fees, stockout events and backorders captured as they happen, and service levels and buffers recalculated per line when the inputs change.
That may mean improving the tools you already use, building an inventory automation system, keeping multichannel stock in one pool with ecommerce inventory automation or managing trade backorders through a wholesale order management system.
Contact OpsMavix with one recent stockout, the records behind it and the handoff that creates the most rework. We can use that evidence to define requirements and a practical pilot.
Getting value from OpsMavix? Add us as a preferred source on Google — you'll see more of our operations content in your AI Overviews, AI Mode and Search.