AI Solutions Locations All Services Website Design Perth Landing Page Design SEO Perth Google Ads Perth Facebook Ads Perth Content & Video Shopify Perth AI Services Case Studies Free Strategy Call
Stock levels guide

Safety Stock Calculation for Mining Spares Three formulas, one worked example.

Safety stock = Z × √(L × σd² + d² × σL²). Z sets the service level, d and σd are average monthly usage and its standard deviation, L and σL are lead time in months and its standard deviation. Example: a spare using 44 a month on a 2.5 month lead time needs 57 units for 95% service.

By , Perth · Updated
Locked cage of critical spares in a mine warehouse
Built inside your systems
Built inside a tier 1 mining operator
99.8% match to the site expert
Your data stays in your systems
Free 15 minute call

What is the safety stock formula?

Safety stock is the extra stock held to cover usage above average and deliveries later than average. The standard formula combines both sources of variation. Two simpler versions are common, and both can mislead.

FormulaWhat it coversWhen to use it
SS = Z × σd × √LUsage variation onlyLead times that are genuinely reliable
SS = Z × √(L × σd² + d² × σL²)Usage and lead time variationMost mining spares, because lead times move
SS = (max usage × max lead time) − (average usage × average lead time)Worst case on both at onceA quick check only. It usually overstates

d is average usage per period, σd is the standard deviation of usage per period, L is average lead time in the same periods, σL is the standard deviation of lead time. Z comes from the service level you choose, which is the chance of not running out during one lead time:

Service levelZ
90%1.28
95%1.645
97.5%1.96
98%2.05
99%2.33

Safety stock then feeds your reorder point: reorder point = d × L + safety stock. See how to set min max levels for the next step.

Worked example: how much safety stock does a steady spare need?

Example with made-up numbers: a conveyor wear part with steady usage and a supplier whose deliveries vary. Monthly net usage over 12 months was 38, 45, 41, 52, 36, 47, 44, 40, 55, 39, 43 and 48.

  1. Average usage d = 528 ÷ 12 = 44 a month.
  2. Standard deviation of usage σd = 5.74 a month (sample standard deviation). σd² = 32.9.
  3. From PO history, average lead time L = 2.5 months, standard deviation σL = 0.75 months.
  4. Target 95% service, so Z = 1.645.
  5. Usage term: L × σd² = 2.5 × 32.9 = 82.3.
  6. Lead time term: d² × σL² = 44² × 0.75² = 1,936 × 0.5625 = 1,089.0.
  7. √(82.3 + 1,089.0) = √1,171.3 = 34.2.
  8. Safety stock = 1.645 × 34.2 = 56.3, round up to 57 units.
  9. Reorder point = 44 × 2.5 + 57 = 110 + 57 = 167 units.

Compare the three formulas on the same part:

MethodSafety stock
Usage variation only: 1.645 × 5.74 × √2.515
Usage and lead time variation57
Max and average: (55 × 4) − (44 × 2.5), with a worst lead time of 4 months110

The lead time term (1,089) is about 13 times the usage term (82). On this part, supplier reliability drives the safety stock, not usage. That is common on remote mine sites. Fixing the supplier's delivery spread would cut more stock than any amount of forecasting.

How does service level change safety stock?

Each step up in service level costs more stock than the last. Using the same part:

Service levelZSafety stock (units)
90%1.2844
95%1.64557
98%2.0571
99%2.3380

Going from 98% to 99% adds 9 units for one point of service. Set service levels by class: higher for parts that stop production, lower for parts with a workaround or a local supplier. Putting 99% on everything is the fastest way to tie up working capital in parts that never needed it.

How do you calculate safety stock for lumpy, slow moving spares?

The standard formula assumes usage follows a smooth bell curve. Lumpy spares, used rarely and several at a time, do not. Model the number of issues and the size of each issue separately.

Example: a pump part with a 6 month lead time (treated as fixed here). Over 24 months it was issued 6 times, in lots of 2, 3, 1, 3, 1 and 4, for 14 units. The last 12 months show 8 units, an average of 0.67 a month with a standard deviation of 1.37.

MethodReorder point at about 95%Problem
Normal formula: 4 + 1.645 × 1.37 × √610Assumes a smooth curve. Close here by luck
Poisson, mean 4 over the lead time8Assumes units are used one at a time. They come 1 to 4 at once
Highest 6 month total in the last 24 months5Only 6 issue events of history. Covers about 77% of outcomes under the model below
Issue events times issue sizes (compound Poisson, simulated)10Best fit, but needs code or an add-in

Four reasonable methods give answers from 5 to 10. On lumpy items the method matters more than the decimal places. Check how many issue events you actually have. Under about 4 to 6 a year, show the number to the maintenance planner and ask what work is coming before you trust any formula.

Why don't critical and insurance spares use the safety stock formula?

Critical and insurance spares are held against a failure, not against usage. Most have no usage history to put in a formula. Decide them on risk.

Example: a $96,000 component for a critical asset with a 6 month replacement lead time. At a holding cost of 20% a year (use your own finance rate), keeping one costs $19,200 a year. The question is whether the asset stopping for up to 6 months would cost more than that, weighted by how likely a failure is. For most critical assets on a mine site, it would. So the answer is usually hold 1, review once a year, and keep it out of any automatic safety stock calculation. More on this in critical and rotable spares.

What mistakes break safety stock calculations on mine sites?

Most errors are in the inputs, not the formula.

  1. Mixed time units. σd in months and L in weeks gives a wrong answer that still looks plausible. Put everything in the same unit.
  2. Quoted lead time instead of actual. Use PO date to receipt date from your own history. For remote sites that includes freight and receipting, which the supplier's quote does not.
  3. Gross usage. Returns counted as usage inflate both d and σd. On an international tier 1 mining operator's stock level work, netting returns off usage took agreement on disputed items from 73% to 98.4%.
  4. Transfers counted as usage. A transfer to another warehouse is not demand. Count usage where the part is issued to a job.
  5. Shutdown spikes. Planned shutdown demand inflates σd. Take planned work out and order it against the work order instead.
  6. Stockouts hide demand. A month with zero issues because the shelf was empty is not a month of zero demand.
  7. Units of measure. Usage in each and stock in boxes of 10 is a common silent error.

How do you calculate safety stock in Excel from an ERP export?

Lay out 12 months of net usage per stock code across columns, calculate lead time statistics from PO history, then apply the formula in one cell.

  1. Export issues and returns for 12 months, net them by month and stock code, and pivot so each row is a code and columns B to M are months.
  2. Export POs with stock code, PO date and receipt date. In that sheet (PO), add a lead time column E: =(D2-C2)/30.4 to get months.
  3. Average usage in N2: =AVERAGE(B2:M2). Standard deviation in O2: =STDEV.S(B2:M2).
  4. Average lead time in P2: =AVERAGEIFS(PO!E:E, PO!A:A, A2).
  5. Lead time standard deviation in Q2: =IFERROR(STDEV.S(FILTER(PO!E:E, PO!A:A=A2)), 0).
  6. Z in R2: =NORM.S.INV(0.95), or look it up from a service level by class.
  7. Safety stock in S2: =ROUNDUP(R2*SQRT(P2*O2^2+N2^2*Q2^2), 0).

Flag any row with fewer than 4 non-zero months or fewer than 3 POs. Those need judgement, not the formula.

How does Source Digital automate safety stock and stock levels?

Source Digital builds a stock level engine inside your own data platform that calculates safety stock, reorder points and max levels for every line, on rules agreed with your stores team. A person approves every change.

  • Matches your experts: at an international tier 1 mining operator, the engine matched the site inventory expert's own spreadsheet 99.8% of the time. See the min max inventory engine case study.
  • Deterministic maths: the numbers come from fixed formulas. The AI only explains why a level changed.
  • Every number links back to the usage, return and PO lines it came from.
  • Read-only: it runs in your Azure, Databricks or Snowflake and does not change your ERP.

Getting started is a free 15 minute call with Tristan, or a quick enquiry. No obligation and no pitch. He asks what you run and what is costing you, then tells you straight whether there is something worth fixing. Work is charged at a consulting day rate. The price depends on your sites, systems and data, so you talk first, then Tristan sets out what he would build, how many days it takes and what it costs. See how the stock level engine works on the mining spares optimisation page.

Data safety

Built inside your environment, not ours

Your data never leaves your systems. We build inside the platform you already run, with the security, logins and audit trail your IT team already controls.

Runs in your own platform

Azure, Databricks, Snowflake or your own SQL server. Your security rules, your logins, your audit trail.

Read-only on your source data

We read from Pronto, SAP, Ellipse or your data warehouse. Nothing writes back into your ERP without approval.

Every number shows its working

Each figure links to the stock record, PO line or contract clause it came from, so anyone can check it in seconds.

A person approves every change

The maths is deterministic and the AI only explains it. Your team decides, and every decision is logged.

Our work

Built and running
in real operations

AI systems running right now inside an international tier 1 mining operator and Perth mining suppliers. Swipe or use the arrows.

Mining, Canada/Africa
Stock levels

A min/max engine matched to the site's own expert

Recommends minimum and maximum stock levels across tens of thousands of items, proven against the inventory expert's own spreadsheet.

99.8%
match to the expert
Read the case study
Mining, Canada/Africa
AI agent

A commercial assistant that answers in Teams

Procurement and commercial staff ask in Microsoft Teams and get verified answers from millions of purchasing, receipt and stock rows.

~1 min
to a verified answer
Read the case study
Mining, Canada/Africa
Price book

A price book built from the client's own contracts

Benchmark rates for services and equipment hire, so quotes are judged against what was agreed and what was last paid.

Every rate
cites its contract
Read the case study
Mining, Canada/Africa
Tender scoring

A tender scorer that cites its evidence

Deterministic pricing plus AI scoring with page referenced evidence, calibrated against a real evaluation panel.

Panel
matched on a live bid
Read the case study
Mining, Canada/Africa
Parts matching

Cross-site parts matching that refuses to guess

Matches the same part across two sites' catalogues using evidence tiers, so stock can be shared instead of re-bought.

2 sites
one view of stock
Read the case study
Mining, Canada/Africa
Data quality

The AI project that audited the data first

Verifying every column surfaced data problems the client didn't know it had, before they could reach an answer.

Every
column verified
Read the case study
Mining, Canada/Africa
Method

Every mistake becomes a permanent test

Users catch it, we trace it, the rule lands and the case is frozen. The method behind every build above.

511
automated checks
Read the case study
Mining, Canada/Africa
Automation

Report delivery with no files carried by hand

Engine outputs delivered from the data platform into SharePoint and announced in Teams, with a return leg for reviewer edits.

0
files carried by hand
Read the case study
Get started

A 15 minute call.
No pitch.

Talk it through with me directly. Here is how it works.

  1. Tell me what you run. Your sites, your systems and what is costing you time or money right now.
  2. I tell you straight. Whether there is something worth fixing, how I would build it and roughly what it would cost.
  3. Scope and price. If it's worth doing, I set out what I'd build, how many days it takes and what it costs at my consulting day rate. If it isn't, I'll say so.
Tristan Sunde
Tristan Sunde
Founder, Source Digital, Perth
0452 246 854 · sales@source-digital.com.au

Send a quick enquiry

Takes 20 seconds. I reply personally, usually the same day.

Your details go to Tristan only. No mailing lists.

FAQ

Common questions

The standard formula is safety stock = Z × √(L × σd² + d² × σL²). Z is set by your service level, 1.645 for 95%. d and σd are average usage per period and its standard deviation. L and σL are average lead time in the same periods and its standard deviation. Use the same time unit for every input.

Set it by class rather than one figure for everything. Parts that stop production justify 98% or 99%. Parts with a workaround, a substitute or a local supplier can sit at 90% or 95%. In a worked example, moving one part from 98% to 99% added 9 units of safety stock for a single point of service.

Because on remote sites it often outweighs usage variation. In a worked example, the lead time term was about 13 times the usage term, so safety stock rose from 15 units to 57 once lead time variation was included. Use actual PO date to receipt date from your own history, not the supplier's quoted lead time.

Model how often the part is issued and how many are taken each time, separately. A simple Poisson model assumes one unit at a time and understates. A short history window can miss rare large issues. A compound Poisson simulation fits best. If a part has very few issue events a year, check with the maintenance planner.

Not in the formula sense. Insurance and critical spares usually have no usage history, so the formula gives zero. They are held against a failure, so decide them on risk: what the part costs to hold each year, how long a replacement takes and what the asset stopping would cost. The answer is usually hold one.

Yes. Pivot 12 months of net usage by stock code into columns and use AVERAGE and STDEV.S. Calculate lead time from PO date to receipt date, then AVERAGEIFS and STDEV.S with FILTER. NORM.S.INV(0.95) gives Z. One ROUNDUP formula then gives safety stock. Flag codes with too little history for judgement.

Source Digital builds a stock level engine inside the client's own data platform with read-only access. It calculates safety stock, reorder points and max levels on agreed rules, links every number to its source lines and has a person approve every change. At an international tier 1 mining operator it matched the inventory expert 99.8% of the time.

Tristan Sunde, founder of Source Digital
Written by Tristan Sunde
Founder and lead developer, Source Digital, Perth WA

Tristan builds AI and data tools for mining supply chains, including a stock level engine, purchase order checks, a contract price book and a commercial assistant in Microsoft Teams for an international tier 1 mining operator. Every page on this site is written from work he has built and tested. More about Tristan.

Find the cash sitting
in your stores.

A 15 minute call. No pitch deck. If there's nothing worth fixing, I'll tell you.