Chi-Square Test Calculator
Run a 2×2 chi-square test of independence and get the χ² statistic and p-value.
Input Data
Count in exposed & outcome-positive cell.
Count in exposed & outcome-negative cell.
Count in unexposed & outcome-positive cell.
Count in unexposed & outcome-negative cell.
Results
2.1978
0.138208
At a glance:χ² = N(ad−bc)² / [(a+b)(c+d)(a+c)(b+d)], with N = a+b+c+d and df = 1.
Formula
χ² = N(ad − bc)² / ((a+b)(c+d)(a+c)(b+d))
$$\chi^2 = \frac{N(ad-bc)^2}{(a+b)(c+d)(a+c)(b+d)}$$How to Use
- Enter the four cell counts a, b, c, d of the 2×2 contingency table.
- The calculator outputs the chi-square statistic χ².
- Read the p-value.
- If p < 0.05, the two categorical variables are significantly associated.
FAQ
When should I use a chi-square test?
When you have two categorical variables (e.g. smoker/non-smoker × ill/well) and want to test whether they are independent. Each expected cell count should ideally be ≥ 5; if too small, use Fisher's exact test instead.
How is chi-square related to correlation?
For a 2×2 table, chi-square can be converted to a Phi coefficient (φ = √(χ²/N)) or Cramér's V to measure association strength, not just whether it is significant.
References
Content reviewed by the Calculatorism editorial team. Results are for reference only; please refer to the relevant authorities for the official figures.