P-Hat Calculator
Calculate the sample proportion and confidence interval for a population proportion.
Enter successes, sample size, and confidence level for the CI bounds.
The sample proportion p-hat = x/n is the most natural estimate of an unknown population proportion p. If you surveyed 100 people and 45 said yes, p-hat = 0.45. That is your best single estimate.
But a point estimate alone tells you nothing about uncertainty. A confidence interval adds that context. The standard Wald interval uses the normal approximation: p-hat plus or minus z * sqrt(p-hat*(1-p-hat)/n), where z is the critical value from the standard normal distribution (1.645 for 90%, 1.960 for 95%, 2.576 for 99%).
This calculator also reports the Wilson score interval, which is more accurate, especially for small samples or proportions near 0 or 1. The Wald interval can produce impossible bounds (below 0 or above 1) in extreme cases; the Wilson interval never does.
Wilson interval: Center = (p-hat + z^2/(2n)) / (1 + z^2/n) Margin = z * sqrt(p-hat*(1-p-hat)/n + z^2/(4n^2)) / (1 + z^2/n)
The standard error of p-hat is SE = sqrt(p*(1-p)/n). Because the true p is unknown, you substitute p-hat. SE shrinks as n grows, which is why larger samples give tighter intervals.
For the normal approximation to be reasonably accurate, you need np-hat >= 5 and n(1-p-hat) >= 5. When both conditions hold, the Wald interval is fine for most purposes. When they do not, use the Wilson interval or the exact Clopper-Pearson interval.
The margin of error is the half-width of the confidence interval: ME = z * SE. For a 95% interval, ME = 1.960 * SE. You can use this to work backwards: if you want a margin of error of 0.03, you need n = (z / ME)^2 * 0.25 (using the worst-case p-hat = 0.5 gives the most conservative sample size).
Proportions from A/B tests, polls, and quality audits all use this framework.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.