Math calculator

p Chart Calculator

Charting a defect rate.

Defective proportion

Twelve inspections with sample sizes from 80 to 400. The average proportion is 0.06448, and a single flat upper limit would sit at 0.11463 — which gets both borderline points wrong. Sample 4 is 42 of 400, a proportion of 0.1050 against its own limit of 0.1013: genuinely out of control, and the flat limit misses it. Sample 5 is 10 of 80, a proportion of 0.1250 against its own limit of 0.1469: comfortably in control, and the flat limit flags it. Across this chart the limits run from 0.1013 to 0.1469.

12 inspections · 167 defectives in 2590 units

Centre 0.06448 defective

The sample sizes differ, so every point has its own limits: they run from 0.1013 to 0.1469 across this chart. 1 of 12 inspections fall outside their own limits. A lower limit exists here, so an unusually good sample is a signal too.

Centre

0.06448

167 of 2590

Limits

per point

samples differ in size

Out of control

1 of 12

4

Average sample

215.8

80 to 400

A single flat upper limit at the average sample size would sit at 0.11463. On this chart it would miss 1 genuinely out-of-control point (#4, 400 units) and falsely flag 1 (#5, 80 units).

Every inspection

Each inspection with its own control limits
#UnitsProportionIts own limitsStatus
12000.060000.01238 to 0.11658
22500.060000.01788 to 0.11108
31500.053330.00432 to 0.12464
44000.105000.02764 to 0.10132outside
5800.125000.00000 to 0.14686
62500.036000.01788 to 0.11108
72000.055000.01238 to 0.11658
81600.087500.00623 to 0.12273
92800.025000.02045 to 0.10851
102100.061900.01363 to 0.11532
111900.052630.01102 to 0.11793
122200.072730.01480 to 0.11415

The half-width is three times √(p̄(1−p̄)/n), so it shrinks with the square root of the sample size. Quadrupling the sample halves the limits.

Per-point limits Binomial, not normal data p and np on one page Needs np̄ above about 5

What this tool shows

On the shipped preset a single flat limit gets both borderline points wrong. Sample 4 is 42 defectives in 400 units — 0.1050 against its own limit of 0.1013, genuinely out of control — and a flat limit of 0.11463 misses it. Sample 5 is 10 in 80: 0.1250 against its own limit of 0.1469, comfortably fine, and the same flat limit flags it. When sample sizes differ, so must the limits.

  • p charts with limits computed per point when the sample sizes differ
  • np charts for counts, when every sample is the same size
  • The cost of flat limits measured on the chart in front of you — which points it misses and which it invents
  • A lower control limit when one exists, because an unusually good sample is a signal too
  • A preset where limits built on the whole record hide a doubling of the defect rate
  • The np̄ condition that decides whether the normal approximation holds at all
Per-point limits Binomial based p and np Flat-limit cost shown

Set the limits on a stable period and hold them. Recomputing as data arrives hides the problem.

Updated 13 September 2026 · Works in any browser, no installation

A p chart tracks the proportion of units that are defective, with limits from the binomial distribution. Each unit either passes or fails, so the variation that a stable process should produce is completely determined by the average rate and the sample size — nothing has to be estimated from the spread of the data. That also means the limits move whenever the sample size does, which is the part most charts get wrong.

At a glance

Formula shown
p̄ = total defectives / total units inspected, pooled across every sample. For sample i the limits are p̄ ± 3·√(p̄(1 − p̄)/nᵢ), so the half-width falls with the square root of the sample size: quadrupling the sample halves the limits. An np chart multiplies both the centre and the half-width by n, which is the same test drawn on a count axis and only defined when every sample is the same size.
Scenario support
Tracking a scrap or rework rate where batch sizes vary, monitoring a pass/fail inspection, charting the proportion of transactions with an error, following a conversion or defect rate over time, and any process where each unit is judged good or bad rather than measured.
Educational estimate
Planning support from the values you enter — not professional advice.

A flat limit is wrong in both directions at once

Drawing one pair of limits across a chart with unequal samples is the most common error on this chart, and the shipped preset shows it failing both ways in the same picture.

Sample 4 is 42 defectives in 400 units. Its proportion is 0.1050 and its own upper limit is 0.1013 — out of control. A flat limit at 0.11463 misses it entirely.

Sample 5 is 10 in 80. Its proportion is 0.1250, which looks worse, and its own limit is 0.1469 — comfortably fine. The same flat limit flags it.

So the chart with flat limits investigates the wrong batch and ignores the right one. Both errors, from one convenience.

The cause is √n. A proportion from 80 units is noisy and a proportion from 400 is not, so across this chart the limits run from 0.1013 to 0.1469.

Limits built on the problem cannot see it

The fourth preset doubles the defect rate halfway through, and the chart reports nothing wrong.

Ten inspections at 4.27% defective, then ten at 9.63%. More than double.

Limits from all twenty: centre 0.06950, upper limit 0.11355, and not one point outside it. The later inspections pulled the centre up and the limit with it.

Limits from the first ten alone: centre 0.04267, upper limit 0.07767 — and every single one of the later ten is outside.

Which is the whole argument for phase one. Establish the limits on a period known to be stable, then hold them fixed. A chart that recomputes its limits as data arrives will absorb any deterioration slow enough to arrive gradually.

The lower limit is not decoration

A point below the lower limit is usually ignored, and it is as informative as one above the upper.

A rate far better than the process normally achieves is a signal that something changed. Possibly for the better, and worth understanding either way.

It is also the classic signature of an inspection problem: an inspector who stopped looking, a gauge that drifted, a batch that was not actually checked.

The lower limit only exists when p̄n is large enough for p̄ − 3σ to stay above zero — on the equal-sample preset it is 0.00977, and on a rarer defect it would be clamped to zero.

When it is clamped, the chart is one-sided and an improvement can never signal, which is a limitation of the design rather than a property of the process.

When the normal approximation stops working

The three-sigma limits assume a binomial close enough to normal, and on rare defects it is not.

The usual condition is np̄ above about 5, and preferably above 10 — at least five defectives expected per sample.

Below that the binomial is skewed and the limits are wrong in both tails. The lower limit clamps to zero and the upper one sits at the wrong place.

The fix is a larger sample, not a different chart. At a 0.5% defect rate you need about 2,000 units per sample to expect ten defectives.

If that is impossible, chart the count of units between defects instead. A g chart is built for rare events and does not fight the approximation.

When every point is out of control

A p chart on large samples often flags almost everything, and the usual conclusion — that the process is wildly unstable — is usually wrong.

The limits assume every unit has the same independent chance of being defective. Real production rarely obliges: batches differ, shifts differ, material lots differ.

That extra variation makes the true spread larger than binomial, and with a large n the binomial limits become very narrow, so the real variation falls outside them constantly.

The tell is a chart where most points are outside and there is no pattern. A genuinely unstable process usually has a shape — a run, a step, a trend.

The response is a Laney p′ chart or an individuals chart on the proportions, both of which widen the limits using the observed between-sample variation rather than assuming it away.

p or c — defective units or defects

The two attribute charts count different things, and using the wrong one puts the wrong distribution underneath the limits.

A p chart counts defective units. Each unit contributes at most one, so the count is binomial and bounded by the sample size.

A c chart counts defects. One unit can have several, so the count is Poisson and unbounded.

Ten scratched panels out of 200 is a p chart. Thirty scratches across those 200 panels is a c chart, and the two questions have different answers.

The giveaway is whether a count can exceed the sample size. If it can, the binomial is the wrong model and the limits here will be too narrow.

Reporting a p chart

Four items, and the second is what makes the limits reproducible.

Give the sample sizes, not just the proportions. The limits depend entirely on them, and a reader cannot reconstruct the chart without them.

Say which period the limits came from. Limits fitted to the whole record are a different object from limits fitted to a stable baseline, and the fourth preset shows the difference is not subtle.

Say whether the limits are per point or flat. If flat on unequal samples, say why — and expect the question.

And give np̄. It is the one number that says whether the normal approximation behind the limits applies at all.

Sources and methodology

References for attribute control charts.

Method. The centre is the pooled proportion — total defectives over total units, not the average of the individual proportions, which would weight a sample of 80 the same as one of 400. Limits are computed per point from that sample’s own size, and the flat-limit alternative is computed alongside so the page can say which points it would miss and which it would invent on the chart in front of you rather than in the abstract. Lower limits are clamped at zero and the clamping is visible, since a chart with no lower limit cannot signal an improvement. The suite asserts on 150 generated charts that the centre is exactly the pooled proportion and that a larger sample always receives narrower limits — the property the flat-limit shortcut discards. It also asserts that a count larger than its own sample size is dropped rather than charted. That engine is verified on every change against 139 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

c Chartc and u charts for defect counts, with the exact Poisson probability of exceeding the three-sigma limit computed rather than assumed.
X-bar and R ChartX-bar with R or S charts, every Shewhart constant computed from its definition rather than looked up, and all eight Nelson rules.
Individuals Control ChartIndividuals and moving range charts with sigma from the average moving range, both sigma estimates shown, and all eight Nelson rules counted.
DPMODefects per million opportunities with the sigma level computed both with and without the 1.5 shift, plus rolled throughput yield.
Binomial DistributionExact binomial probabilities at any n — including thousands, where a factorial overflows — with the normal approximation beside them and its error measured, which is 0.6% at the centre and 261% in the tail.
One-Proportion Z-TestThe score z-test with the exact binomial test beside it: 60 of 100 against 0.5 gives p = 0.0455 by one and 0.0569 by the other — opposite verdicts at the conventional threshold, on identical data.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. The limits assume every unit has the same independent chance of being defective; real production rarely does, and on large samples that shows up as a chart where almost every point is flagged. The normal approximation behind three-sigma limits also needs about five expected defectives per sample, which a rare defect will not supply.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Launched p and np charts with limits computed per point whenever the sample sizes differ.
  2. Measured the cost of a flat limit on the chart itself: on the shipped preset it misses the point that is out of control and flags the one that is not.
  3. Shipped a preset where limits fitted to all twenty inspections hide a doubling of the defect rate that limits from the stable first ten expose on every later point.
  4. Reported the lower control limit when one exists, since an unusually good sample is a signal too.
  5. Documented the np-bar condition that decides whether the normal approximation behind three-sigma limits applies.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.