Zero Signup ToolsFree browser tools

Calculator Tools

Chi-Square Test Calculator

Run chi-square tests on raw data. Get the statistic, degrees of freedom, p-value, expected counts, residuals, Cramer's V effect size, and a distribution plot.

Test mode

Enter a contingency table of observed counts. The test asks whether the rows and columns are independent. Used for survey cross-tabs, A/B tests with categorical outcomes, and medical 2x2 tables.

Observed counts

Fill the cells with the number of observations. Use the label fields to name your rows and columns: those names show up in the breakdown and the copied report.

Empty corner

Rows

2 / 6

Columns

2 / 6

Examples

Load a textbook or real-world scenario. Replaces the current data for its mode.

Result

Chi-square (χ²)

5.769231

Degrees of freedom

1

p-value

0.0163092

1.6309% of the chi-square distribution lies above the observed statistic.

Alpha = 0.10

Reject H₀

Alpha = 0.05

Reject H₀

Alpha = 0.01

Fail to reject H₀

Phi (φ)

0.2402

Effect size for 2x2 tables. |φ| = sqrt(χ² / N).

Cramer's V

0.2402 (Small)

Effect size for any R x C table. Ranges 0 to 1.

Contingency coefficient

0.2335

Pearson's C. Sensitive to table size, ranges 0 to <1.

With χ² = 5.7692 on 1 degree(s) of freedom, the p-value is about 0.0163092. At α = 0.05 we reject independence: rows and columns appear to be associated. Cramer's V = 0.2402 (small effect).

χ² = 5.76920.01.22.43.54.75.97.1Chi-square statistic (df = 1)

Expected counts

Eᵢⱼ = (row total × column total) / grand total.

 YesNoTotal
Group A242650
Group B242650
Total4852100

Standardized residuals

zᵢⱼ = (O - E) / sqrt(E(1 - row p)(1 - col p)). Cells outside ±2 are large contributors to the chi-square statistic.

 YesNo
Group A2.4-2.4
Group B-2.42.4

How to use

  1. Pick a mode: Independence for an R x C contingency table of observed counts, or Goodness of fit for a single list of observed counts vs a hypothesized distribution.
  2. Independence: type observed counts into the table. Rename rows and columns to match your variables. Use Add row, Remove row, Add column, Remove column to resize the table (2 to 6 in each direction).
  3. Goodness of fit: enter one row per category, the observed count, and either the hypothesized probability (decimal, percent, fraction, or ratio) or the expected count. Add or remove categories with the row controls.
  4. Read the chi-square statistic, degrees of freedom, p-value, percent of distribution above the observed statistic, decision verdicts at alpha 0.10, 0.05, 0.01, and (Independence only) the phi, Cramer's V, and contingency coefficient effect sizes.
  5. Check the expected-counts and residuals tables. Cells with |residual| above 2 are highlighted: positive means observed exceeds expected, negative means observed falls short.
  6. Use the example chips to load classic scenarios (treatment vs control, Mendelian 9:3:3:1, fair die, voter share vs poll), or Copy summary or Copy full report to paste the results into homework, a spreadsheet, or a launch doc.

About this tool

Chi-Square Test Calculator runs both standard chi-square tests directly on raw data, not just on a precomputed statistic. Pick Independence (R x C) to test whether two categorical variables are associated (treatment vs outcome, gender vs preference, region vs channel, A/B variant vs conversion bucket), or Goodness of fit to test whether observed counts come from a hypothesized distribution (a fair die, Mendelian ratios, voter share vs poll, channel mix vs forecast). For Independence, type observed counts into a contingency table up to 6 x 6, add or remove rows and columns on the fly, and the page returns the chi-square statistic, the degrees of freedom (R - 1)(C - 1), the upper-tail p-value, the table of expected frequencies (row total times column total divided by grand total), the Pearson residuals (O - E) / sqrt(E), the standardized residuals corrected for marginal proportions (cells outside +/- 2 are highlighted as large contributors), and three effect-size measures: phi for 2 x 2 tables, Cramer's V for any R x C table with a qualitative small/medium/large label, and the contingency coefficient. For Goodness of fit, enter observed counts in 2 to 20 categories and pick how to specify the hypothesized distribution: Probability / ratio accepts decimals, percents, fractions, and integer ratios (a 9, 3, 3, 1 Mendelian ratio just works), while Expected count accepts raw expected frequencies and rescales them to the observed total before the test runs. Either way you get the chi-square statistic, df = categories - 1, the p-value, a per-category breakdown with O - E, (O - E)^2 / E, and Pearson residual, and a flag on cells whose residual exceeds 2. Both modes share a live SVG chi-square distribution plot for the matching df with the upper tail shaded and the observed statistic marked, decision verdicts at alpha 0.10, 0.05, and 0.01, a plain-English interpretation, and a sample-size warning if more than zero expected cells fall below 5 (the rule of thumb where the chi-square approximation gets unreliable and an exact test is preferred). The numerics use the regularized lower incomplete gamma function with series expansion for x below a + 1 and continued fraction otherwise, backed by the Lanczos log-gamma approximation. This gives roughly 1e-9 accuracy in the useful range, with values below 1e-7 reported as < 1e-7 so the displayed precision is never overstated. Everything runs locally in your browser, so the counts you type for class, work, or research stay on your device. Useful for AP Statistics and college statistics homework, A/B test analysis when the outcome is categorical (not just a proportion), survey cross-tabs, medical 2 x 2 tables with treatment vs control vs outcome, quality control with defect categories, biology dihybrid crosses, channel-mix sanity checks against a forecast, and any time you have observed counts and need a defensible significance decision. Pair this tool with the P-Value Calculator when you only have a chi-square statistic in hand, with the Binomial Distribution Calculator when there are two outcomes and a fixed sample size, with the Poisson Distribution Calculator for rare-event count data, or with the Confidence Interval Calculator when you also want an interval estimate.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsCalculator Tools