np Chart Calculator — Number Defective with Constant Sample Size
The number-defective chart for a fixed inspection quantity: centre line np̄, limits np̄ ± 3√(np̄(1−p̄)), plotted in the raw counts the shop floor actually recorded — with a check that the sample size really is constant, because when it is not the counts are not comparable and the p chart is the right instrument.
p chart or np chart — the whole decision, in one section
They are the same chart in different units. The np chart plots Dᵢ, the number of defective items; the p chart plots Dᵢ/nᵢ, the fraction. When n is constant the np limits are exactly n times the p limits — √(np̄(1−p̄)) is n·√(p̄(1−p̄)/n) — so the two charts flag precisely the same points, and this tool asserts that identity to full double precision in its test suite rather than assuming it.
The one thing that decides it is whether n is constant. If your inspection quantity varies, even a little, the np chart stops being defined: eleven defectives out of two hundred and eleven out of five hundred are not the same result, and a chart that plots both as "11" is telling the reader something untrue. The p chart divides that problem away.
When n really is fixed, prefer the np chart if the people reading it recorded counts. "Fourteen rejects out of five hundred, and the limit is twenty-one" is a sentence an operator can check against their own tally sheet. "0.028, and the limit is 0.042" is the same fact in a form that invites arithmetic errors at the point of use. That is a human-factors argument rather than a statistical one, and it is the only argument for the np chart — which is fine, because it is a good one.
Data
Paste straight from Excel, Minitab or a CMM export — include the header row and the columns are matched by name, in any order.
| # | Sample(opt) | Inspected | Defective | |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 |
0 rows of data
Loading the calculation engine…
Enter data on the left to chart it
SVG is vector — it stays sharp at any size in a report. PNG 4× is roughly 600 dpi at figure width. Every export carries the estimator, the constants and the rule set drawn inside the figure, so the file is readable on its own.
Downloads carry a small “made with spcplot.com” credit along the bottom edge. The chart on screen is never watermarked, and the credit is a credit rather than a licence restriction — the figures are yours to publish either way. A Pro or Lifetime licence removes it.
Options
This plot has no adjustable options yet.
Your measurements are processed entirely in this browser tab. Nothing you type here is uploaded, so confidential production data stays confidential.
How the limits are computed
Centre line np̄ = n·p̄, where p̄ = ΣDᵢ/Σnᵢ pooled across the study — which at constant n is just the average number defective per subgroup. Limits np̄ ± 3√(np̄(1−p̄)), the standard error of a binomial count.
The lower limit is floored at zero and the upper at n, because a subgroup cannot produce fewer than no defectives or more defectives than it contains. Both clamps are drawn differently from a real limit and named in the disclosure block, because a dashed line at zero that looks like a control limit is a claim the chart cannot support.
No Shewhart constant appears anywhere. d₂, c₄, A₂ and the rest exist to turn a range or a mean deviation into an estimate of σ for a normally distributed measurement. A count of defective items is binomial: its variance is a known function of its own mean, and there is nothing left to estimate.
What this tool does when your n is not constant after all
It draws the chart and tells you not to trust it. The centre line and the limits step with nᵢ — which is arithmetically the right thing to do with the numbers you supplied — and the figure carries a warning naming the p chart as the tool that handles the situation properly.
It does not silently average your sample sizes and draw one flat pair of limits. That is the most common wrong implementation of an attribute control chart, and it is invisible: the figure looks exactly like a correct one, and the only symptom is alarms on your small subgroups that nobody can trace to a cause.
Reading the figure
A solid line is the centre line; dashed lines are the control limits; a point in red with a number beside it failed the test with that number. The active rule set is printed under the chart, because Nelson, Western Electric and ISO 7870-2 flag different points on identical data. The default is Nelson test 1 alone, which is Minitab’s out-of-the-box behaviour.
The page opens on the NIST/SEMATECH proportions dataset — thirty wafers, fifty chips inspected on each — which is the dataset the validation page reproduces, so the figure in front of you is the checked one. Two of the thirty lots are out of control. A third, at twenty defectives against an upper limit of 20.51, is not: out of control means beyond the limit, strictly, and that near miss is on the default view deliberately.
Common questions
- What is the np chart formula?
- Centre line np̄ = n·p̄ with p̄ = ΣDᵢ/Σnᵢ. Limits np̄ ± 3√(np̄(1−p̄)), floored at 0 and capped at n. Constant n only — the formula has a single n in it, and there is nowhere for a varying one to go.
- What is the difference between an np chart and a c chart?
- What is being counted. An np chart counts defective ITEMS out of a fixed number inspected, so the count has a ceiling and the distribution is binomial. A c chart counts DEFECTS in a fixed area of opportunity — a count with no upper bound, and a Poisson distribution. Three scratches on one panel are one defective item and three defects. The two charts give different limits on the same raw numbers.
- My sample size changes slightly. Can I still use an np chart?
- No, and "slightly" is doing more work in that sentence than it can carry. The whole content of the chart is that the counts are comparable, and they are comparable only because the denominators are identical. Use the p chart; it costs you nothing except an axis in fractions, and it is correct.
- Why is there no lower control limit on my np chart?
- Because np̄ − 3√(np̄(1−p̄)) came out negative, which happens when the expected number of defectives per subgroup is small. The figure prints the value the arithmetic actually produced. While the lower limit is clamped the chart cannot signal an improvement, and the zone tests below the centre line are suppressed rather than reported as passed.
- How large should the subgroup be for an np chart?
- Large enough that you expect at least about five defectives in it — the usual rule of thumb, and the point below which the normal approximation behind ±3σ stops describing the binomial. At a 1% defective rate that means five hundred items per subgroup. If that is impractical, an attribute chart may be the wrong instrument and a chart of the number of items between failures may serve better.
- Is my data uploaded anywhere?
- No. The whole calculation runs as JavaScript in this browser tab, and nothing on this site accepts a measurement — the only server code here takes a payment. That is why the tool is usable on data you are contractually barred from putting in a cloud service.