Chi-Square Test Calculator
Calculate the chi-square (χ²) statistic for goodness-of-fit or independence tests. Enter observed and expected frequencies to get χ² and p-value.
Did this tool work for you?
How to use this calculator
Sum the squared difference between observed (O) and expected (E) frequencies divided by expected, across all categories.
- 1
Enter observed frequencies (actual counts) for each category.
- 2
Enter expected frequencies (what you would expect under the null hypothesis).
- 3
The calculator returns χ² and the p-value for df = categories − 1.
- 4
If p < α, the observed distribution significantly differs from expected.
Frequently asked questions
What is the chi-square test used for?
Chi-square tests determine whether observed categorical data matches an expected distribution (goodness-of-fit) or whether two categorical variables are independent of each other (independence test).
What are degrees of freedom in chi-square?
Degrees of freedom = number of categories − 1 for goodness-of-fit tests. For contingency tables: df = (rows − 1) × (columns − 1).
What sample size do I need?
Expected frequencies should be at least 5 in each cell. If any expected frequency is below 5, consider merging categories or using Fisher's exact test instead.
Chi-Square Test Calculator — χ² Statistic & P-Value
When to use the chi-square test
Use the goodness-of-fit chi-square test to compare an observed frequency distribution against a theoretical one — for example, checking if dice rolls are fair. Use the chi-square test of independence to test whether two categorical variables (like gender and voting preference) are related.
Assumptions and limitations
Chi-square tests require: independent observations; categorical data; expected frequencies of at least 5 per cell. The test tells you whether a difference exists, not how large or important the difference is — combine it with effect size measures like Cramér's V.
Learn more from an authoritative source:
WikipediaConfidence Interval Calculator
Calculate the confidence interval for a population mean from sample data. Supports 90%, 95%, and 99% confidence levels.
Sample Size Calculator
Calculate the minimum sample size required for a statistically valid survey or experiment. Specify confidence level, margin of error, and population size.
Percentile Calculator
Find the percentile rank of a score in a dataset, or find the value at a given percentile. Enter up to 10 data values.
Poisson Distribution Calculator
Calculate Poisson probabilities for rare events. Find P(X = k), P(X ≤ k), and P(X > k) given an average rate λ.
Variance Calculator
Calculate variance and standard deviation for a set of numbers. Choose population variance (σ²) or sample variance (s²).
Standard Error Calculator
Calculate the Standard Error of the Mean (SEM) from standard deviation and sample size. Includes margin of error for 90%, 95%, and 99% confidence levels.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →