Observed Values (Contingency Table)
Enter observed counts. Add/remove rows and columns as needed. Expected values and χ² will be calculated automatically.
Formula: χ² = Σ (O − E)² / E, where Expected E = (Row Total × Column Total) / Grand Total
Goodness-of-Fit Test
Enter observed counts and expected counts (or expected proportions that sum to 1).
P-Value from Chi-Square
Enter chi-square value and degrees of freedom to get the p-value.
Degrees of Freedom for Chi-Square
For a contingency table: df = (rows − 1) × (columns − 1).
What is the Chi-Square Test?
The Chi-Square (χ²) test is used to check whether two categorical variables are independent (Test of Independence) or whether observed counts follow a hypothesized distribution (Goodness-of-Fit). You get a χ² statistic, degrees of freedom, and a p-value to decide significance.
Types of Chi-Square Tests
- Test of Independence: For a contingency table (e.g. rows = gender, columns = preference). Tests if the two variables are related.
- Goodness-of-Fit: Compares observed counts to expected counts (or proportions) to see if data fit a distribution.
When to Use Chi-Square?
Use when you have categorical data and counts in categories. Common in surveys, A/B tests, and research. Expected cell counts should ideally be at least 5 for more reliable results.
Formula
χ² = Σ (Observed − Expected)² / Expected
Expected = (Row Total × Column Total) / Grand Total
Frequently Asked Questions
What is the chi-square test used for?
It is used to test whether two categorical variables are independent (test of independence) or whether observed data fit an expected distribution (goodness-of-fit). Common in statistics, research, and data analysis.
How do you calculate chi-square?
Compute expected values for each cell as (row total × column total) / grand total. Then χ² = Σ (O − E)² / E over all cells. Use degrees of freedom df = (rows − 1)(columns − 1) and a chi-square table or calculator to get the p-value.
What is a good p-value?
Typically p < 0.05 is considered significant (reject the null hypothesis). Stricter levels are 0.01 or 0.001. If p ≥ α, we fail to reject the null hypothesis.
What does chi-square significance mean?
If p < α, the result is statistically significant: we reject the null hypothesis (e.g. variables are not independent). If p ≥ α, we fail to reject the null (e.g. no evidence against independence).
Relevant Tools
More statistics and math calculators.
Z Score Calculator
Convert raw scores to z-scores and find probabilities.
CalculateT Test Calculator
Perform one-sample and two-sample t-tests.
CalculateStandard Deviation Calculator
Compute sample and population standard deviation.
CalculatePercentage Calculator
Calculate percentages and percentage change.
CalculateMarks Percentage Calculator
Calculate marks percentage and grades.
CalculateAll Calculators
Browse all calculators.
Browse