StatCalc
Sample size, confidence intervals, p-values, chi-square tests, and regression. The stats tools you need for research, coursework, and A/B tests.
Sample Size Calculator
Calculate the minimum sample size needed for a survey or experiment.
Confidence Interval Calculator
Calculate a confidence interval for a sample mean or proportion.
P-Value Calculator
Find the p-value from a test statistic (z-score or t-score).
Chi-Square Test Calculator
Run a chi-square goodness-of-fit or independence test from observed and expected values.
Simple Linear Regression
Fit a line to X-Y data. Find slope, intercept, R², and make predictions.
About StatCalc
StatCalc provides free statistics calculators for students, researchers, and data analysts. Calculate sample sizes, find confidence intervals, run chi-square tests, and fit simple regression lines — all in your browser.
Results include formulas used so you can verify the math. Share calculations via URL for collaboration with classmates or colleagues.
Sample size calculation determines how many observations you need for a result to be statistically meaningful. The required sample grows with higher confidence (99% needs more samples than 95%) and shrinks with larger expected effect sizes. For proportions, the classic formula is n = (Z² × p × (1−p)) / e², where Z is the critical value (1.96 for 95% CI), p is the expected proportion, and e is the margin of error. A poll estimating 50% approval (worst-case variance) at ±3% margin requires n = (1.96² × 0.5 × 0.5) / 0.03² = 1,067 respondents.
Confidence intervals quantify the uncertainty in a sample estimate. A 95% confidence interval means that 95% of intervals constructed this way from repeated sampling would contain the true population parameter. Wider intervals mean less precision; narrower intervals require larger samples. For a mean: CI = x̄ ± t × (s / √n), where t comes from the t-distribution for your degrees of freedom and s is the sample standard deviation.
P-value interpretation: the p-value is the probability of observing results at least as extreme as yours, assuming the null hypothesis is true. A p-value of 0.03 does not mean "3% chance the null is true" — it means "if the null were true, results this extreme occur 3% of the time by chance." The common threshold of p < 0.05 is a convention, not a law. Small p-values with tiny effect sizes may be statistically significant but practically irrelevant.
Chi-square test: used to determine if observed categorical frequencies differ from expected frequencies (goodness-of-fit) or if two categorical variables are independent (contingency table). χ² = Σ (O − E)² / E. Degrees of freedom for a contingency table = (rows − 1) × (columns − 1). Minimum expected frequency per cell should be ≥5 for the approximation to be reliable.
Regression: simple linear regression fits the model ŷ = a + bx by minimizing the sum of squared residuals. The slope b = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / Σ[(xᵢ − x̄)²] and intercept a = ȳ − b × x̄. R² measures the proportion of variance in y explained by x — from 0 (no fit) to 1 (perfect fit). A high R² doesn't imply causation, and a low R² may still yield a useful, statistically significant relationship if the sample is large enough.