Methodology
How every calculator on this site turns your numbers into an answer, and how we check that the answer is right.
Where the calculations happen
All 24 calculators run entirely in your browser in JavaScript. Nothing you type is sent to a server, stored or logged. Results update as you type because there is no network round trip.
Exact arithmetic for proportions and ratios
The dedicated proportion, ratio and conversion calculators never convert your inputs straight to floating-point decimals. Each value is parsed into an exact fraction, a numerator over a denominator reduced by their greatest common divisor, and all arithmetic (addition, multiplication, division, cross multiplication) is done on those fractions. A decimal appears only at the end, next to the exact form. This is why 1/3 × 3 comes out as exactly 1 rather than 0.9999999.
- Accepted input: whole numbers, decimals (2.75), fractions (3/4), mixed numbers (1 1/2), percentages (40%) and thousands separators.
- Recurring decimals are marked with an ellipsis (0.333333…) so you know the decimal is not exact.
- Square roots, used by the mean proportional calculator, are given in simplified surd form (4√3) when they are irrational.
- Ratios are simplified by scaling every term to a whole number with the least common multiple of the denominators, then dividing by the greatest common divisor.
- The main proportion calculator on the homepage is the exception: it works in decimal arithmetic, shows answers to up to 6 decimal places, and adds the matching fraction when the answer is a fraction with a denominator up to 1,000. The variables solver further down the homepage uses exact fractions.
How Do the Statistics Calculators Work?
The proportion statistics calculators use the standard large-sample (normal approximation) methods taught in introductory statistics, with the following details.
Normal distribution
The standard normal CDF Φ(z) is computed from a Chebyshev approximation to the complementary error function with fractional error below 1.2 × 10⁻⁷ everywhere. Critical values z* use Acklam's rational approximation to the inverse normal CDF, refined with one Halley step. For example, z* for 95% confidence is 1.959964. p-values are shown to four decimal places, or as "< 0.0001".
Formulas
- Sample proportion: p̂ = x / n, standard error √(p̂(1 − p̂)/n).
- One-proportion z-test: z = (p̂ − p₀) / √(p₀(1 − p₀)/n), using the null value p₀ in the standard error.
- Two-proportion z-test: pooled proportion (x₁ + x₂)/(n₁ + n₂) in the standard error, as the null hypothesis assumes one shared proportion.
- Confidence interval for one proportion: Wald p̂ ± z*·SE, Wilson score interval (Wilson, 1927), and Agresti–Coull (Agresti & Coull, 1998). When there are fewer than 10 successes or failures, the Wilson interval is shown as the main answer, following the recommendation of Brown, Cai & DasGupta (2001).
- Confidence interval for p₁ − p₂: unpooled standard error √(p̂₁q̂₁/n₁ + p̂₂q̂₂/n₂).
- Sample size: n = z*²·p(1 − p)/E², always rounded up, with optional finite population correction n₀ / (1 + (n₀ − 1)/N).
Conditions
Every statistics tool checks the large-sample condition, at least 10 expected successes and 10 expected failures, and shows a caution when it is not met. The calculators cannot check whether your sample was random or your observations independent; those depend on how the data were collected.
How we test
The worked examples printed on the statistics pages were produced by the same code the calculators run, and the critical values match standard z-tables (1.645, 1.960 and 2.576 for 90%, 95% and 99%). For instance, the one-proportion test on 62 heads in 100 tosses gives z = 2.40 and a two-tailed p-value of 0.0164. Inputs that would break a formula, such as division by zero, a proportion outside 0–1 or more successes than trials, are rejected with an explanation instead of returning a misleading number.
Corrections
If you find an answer you believe is wrong, please contact us with the inputs you used and the result you expected. We check every report, fix confirmed errors promptly, and update the affected page's worked examples.
References
- Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209–212. doi:10.1080/01621459.1927.10502953
- Agresti, A., & Coull, B. A. (1998). Approximate is better than "exact" for interval estimation of binomial proportions. The American Statistician, 52(2), 119–126. doi:10.1080/00031305.1998.10480550
- Brown, L. D., Cai, T. T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101–133. doi:10.1214/ss/1009213286
- Press, W. H., et al. Numerical Recipes, section on the error function (erfc approximation).