Every survey result, poll, and A/B test funnels down to one symbol: p̂, “p-hat,” the proportion of successes in your sample. If 87 of 200 surveyed customers say they would buy again, p̂ = 0.435 — but that number is an estimate, not a fact, and the honest question is how much trust it deserves. This p-hat calculator computes the sample proportion, its standard error, and confidence intervals, so the estimate arrives with its margin of doubt attached.
What P-Hat Means
Statisticians write p for the true proportion in the whole population — a number usually unknown and often unknowable — and p̂ (p-hat) for the proportion measured in a sample: p̂ = x ÷ n, successes divided by total trials. The “hat” is the discipline’s way of marking an estimate: p̂ wears the hat because it stands in for p. Everything in survey statistics is about the relationship between the two — how far p̂ is likely to sit from p, and how large n must be before the gap shrinks to a size you can live with.
The Standard Error of a Proportion
Repeated samples would give slightly different p̂ values each time, scattered around the true p. The typical scatter is the standard error: SE = √( p̂(1 − p̂) ÷ n ). Two lessons hide in the formula. First, uncertainty peaks at p̂ = 0.5 and shrinks toward the extremes — a 90/10 result is pinned down more tightly than a 50/50 one at the same n. Second, n sits under a square root: to halve the standard error you must quadruple the sample. That square root is the economics of polling — it is why surveys plateau around 1,000 respondents.
Worked Example: A Customer Survey
A shop surveys 200 customers and 87 say they would buy again. p̂ = 87 ÷ 200 = 0.435. The standard error is √(0.435 × 0.565 ÷ 200) = 0.0351. The 95 percent confidence interval is 0.435 ± 1.96 × 0.0351 = 0.435 ± 0.069, or (0.366, 0.504). Read it honestly: the data is consistent with true repeat-buy intent anywhere from about 37 to 50 percent. A manager who plans around “43.5 percent” as a certainty is reading more precision into the survey than the survey contains.
When the Normal Interval Is Safe — and When It Is Not
The p̂ ± z × SE interval relies on the sampling distribution being roughly normal, which needs enough successes and failures: the usual rule is at least 10 of each (x ≥ 10 and n − x ≥ 10; some texts say 15). Below that, or when p̂ is near 0 or 1, the plain interval misbehaves — it can dip below 0 or above 1 and its true coverage falls short of 95 percent. The fixes used in practice are the Wilson score interval and the Agresti-Coull adjustment (add two successes and two failures, then use the plain formula). For moderate samples with a healthy mix of outcomes, the interval this calculator reports is the standard textbook result.
P-Hat in A/B Testing and Quality Control
Conversion rates are p̂ values: 87 conversions from 200 visitors is the worked example wearing a different hat. Comparing two versions means comparing two p̂’s, where the difference needs its own standard error — but the width of each side’s interval is still the first sanity check on whether a gap could be noise. In manufacturing, p̂ is the defect proportion on a control chart, with limits set at p̂ ± 3 SE; a batch outside the limits triggers investigation. Same symbol, same formula, same square-root economics everywhere.
Common Mistakes
Reporting p̂ as a percentage without the sample size strips out the uncertainty — “43.5 percent” from n = 200 and from n = 20,000 are different claims entirely. Another classic: treating the confidence interval as a probability about this one sample, rather than a property of the procedure over repeated samples. And the sampling sin that no formula repairs: a biased sample. p̂ arithmetic assumes random selection; a voluntary-response poll produces a precise answer to the wrong question.
Related Tools
More inference tools are in the Statistics Calculators hub, including the Central Limit Theorem Calculator and the Z-Score Calculator.
Frequently Asked Questions
How do you calculate p-hat?
Divide successes by total trials: p̂ = x ÷ n. If 87 of 200 respondents agree, p̂ = 87 ÷ 200 = 0.435, or 43.5 percent.
What is the difference between p and p-hat?
p is the true proportion in the entire population, usually unknown. p̂ is the proportion measured in your sample — an estimate of p, marked with the “hat” to show it is estimated from data.
How do I get the standard error of p-hat?
SE = √( p̂(1 − p̂) ÷ n ). For p̂ = 0.435 and n = 200, SE = 0.0351. The standard error is the typical distance between a sample’s p̂ and the true p.
What sample size do I need for a margin of error of 3 percent?
At the worst case p̂ = 0.5, n = (1.96 ÷ 0.03)² × 0.25 ≈ 1,068. That is why professional polls cluster around a thousand respondents — beyond that, precision gains slow to a crawl.
Why does my confidence interval go below 0 or above 1?
The normal approximation breaks down for small samples or extreme proportions. Use the Wilson score interval instead, and check that you have at least about 10 successes and 10 failures before trusting the plain interval.
Is p-hat a percentage or a decimal?
Both — it is a proportion between 0 and 1, which you may report as a percentage by multiplying by 100. Formulas expect the decimal form.
What does a 95 percent confidence interval for p-hat mean?
If the same sampling procedure were repeated many times, about 95 percent of the intervals built this way would contain the true p. It is a statement about the method’s reliability, computed here as p̂ ± 1.96 × SE.