This free chi square calculator runs a chi-square test of independence on any contingency table up to 12 × 12, a chi-square goodness-of-fit test against equal, custom-count or ratio expectations (like 9:3:3:1), and finds the p-value from a chi-square statistic or the critical value for any df and α. You get χ², degrees of freedom, the p-value, a reject or fail-to-reject decision, a table of expected counts with each cell’s contribution and adjusted residual, Cramér’s V, a Yates correction and Fisher exact p-value for 2 × 2 tables, a shaded chi-square curve, full step-by-step working and the exact TI-84 keystrokes for χ²-Test and χ²GOF-Test.
Contents
How to Use the Chi-Square Calculator
- Pick the test. Test of independence for a two-way table, Goodness of fit for one list of counts, or P-value / critical value if you already have χ² and df.
- Enter counts. For a table, type one row per line with columns separated by spaces, commas or tabs. You can paste a block straight from Excel or Google Sheets. For goodness of fit, list the observed counts and choose equal expected values, expected counts, or proportions, percentages or a ratio.
- Choose α. Type any significance level or tap 0.10, 0.05, 0.025, 0.01 or 0.001.
- Read the answer. The results update as you type: p-value, χ², df, critical value, the decision, an expected-count table with a heat map of contributions, and the TI-84 steps. Copy share link saves your exact inputs in the URL.
Chi-Square Formula and Degrees of Freedom
Every chi-square test compares observed counts O with the counts E you would expect if the null hypothesis were true:
χ² = Σ (O − E)² / E
| Test | Expected count E | Degrees of freedom | H₀ |
|---|---|---|---|
| Goodness of fit | Ei = n × pi | k − 1 | The data follow the stated distribution |
| Independence / homogeneity | Eij = (row total × column total) / n | (r − 1)(c − 1) | The two variables are independent |
The p-value is the right-tail area P(χ²df ≥ your χ²). Chi-square tests are always right-tailed, because any mismatch between O and E makes χ² bigger.
Chi-Square Goodness-of-Fit Test (Worked Example)
Is a die fair? It is rolled 60 times and gives 8, 9, 19, 5, 8 and 11 for faces 1–6. If it is fair, each face is expected 60 / 6 = 10 times.
| Face | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Observed O | 8 | 9 | 19 | 5 | 8 | 11 |
| Expected E | 10 | 10 | 10 | 10 | 10 | 10 |
| (O − E)²/E | 0.4 | 0.1 | 8.1 | 2.5 | 0.4 | 0.1 |
χ² = 0.4 + 0.1 + 8.1 + 2.5 + 0.4 + 0.1 = 11.6 with df = 6 − 1 = 5. The p-value is P(χ²5 ≥ 11.6) = 0.0407. Because 0.0407 ≤ 0.05 (and 11.6 > the critical value 11.070), we reject H₀: there is evidence the die is not fair. Face 3 contributes most of the statistic.
Ratio example (Mendel’s peas): observed 315, 108, 101, 32 against a 9:3:3:1 ratio. Expected counts are 312.75, 104.25, 104.25 and 34.75, so χ² = 0.470, df = 3, p = 0.9254. We fail to reject H₀; the data fit the 9:3:3:1 ratio well. Tap Mendel 9:3:3:1 example in the calculator to see it.
Chi-Square Test of Independence (Worked Example)
A survey asks 395 people (two groups) which of four options they prefer:
| A | B | C | D | Total | |
|---|---|---|---|---|---|
| Group 1 | 60 | 54 | 46 | 41 | 201 |
| Group 2 | 40 | 44 | 53 | 57 | 194 |
| Total | 100 | 98 | 99 | 98 | 395 |
- Expected counts: E = row total × column total / n. For Group 1, A: 201 × 100 / 395 = 50.886.
- Contribution: (60 − 50.886)² / 50.886 = 1.632. Repeat for all 8 cells.
- Add them: χ² = 8.006, df = (2 − 1)(4 − 1) = 3.
- P-value: P(χ²3 ≥ 8.006) = 0.0459, below α = 0.05, so reject H₀: preference is associated with group.
- Strength: Cramér’s V = √(8.006 / (395 × 1)) = 0.142, a small association.
This is the default example in the calculator, so you can check each cell’s expected count and adjusted residual there. The same test is called the chi-square test of homogeneity when the rows are separate samples; the arithmetic is identical.
How to Find the P-Value from a Chi-Square Statistic
Already have the statistic? Open the P-value / critical value tab, enter χ² and df, and read the right-tail p-value, the left area and a row of critical values. By hand or on a TI-84, p-value = χ²cdf(χ², 1E99, df). For example, χ² = 7.815 with df = 3 gives p ≈ 0.0500, and χ² = 3.841 with df = 1 gives p ≈ 0.0500.
Chi-Square Critical Value Table
Reject H₀ when your χ² is greater than or equal to the critical value for your df and α (right-tail area).
| df | α = 0.10 | α = 0.05 | α = 0.025 | α = 0.01 | α = 0.005 | α = 0.001 |
|---|---|---|---|---|---|---|
| 1 | 2.706 | 3.841 | 5.024 | 6.635 | 7.879 | 10.828 |
| 2 | 4.605 | 5.991 | 7.378 | 9.210 | 10.597 | 13.816 |
| 3 | 6.251 | 7.815 | 9.348 | 11.345 | 12.838 | 16.266 |
| 4 | 7.779 | 9.488 | 11.143 | 13.277 | 14.860 | 18.467 |
| 5 | 9.236 | 11.070 | 12.833 | 15.086 | 16.750 | 20.515 |
| 6 | 10.645 | 12.592 | 14.449 | 16.812 | 18.548 | 22.458 |
| 7 | 12.017 | 14.067 | 16.013 | 18.475 | 20.278 | 24.322 |
| 8 | 13.362 | 15.507 | 17.535 | 20.090 | 21.955 | 26.124 |
| 9 | 14.684 | 16.919 | 19.023 | 21.666 | 23.589 | 27.877 |
| 10 | 15.987 | 18.307 | 20.483 | 23.209 | 25.188 | 29.588 |
| 12 | 18.549 | 21.026 | 23.337 | 26.217 | 28.300 | 32.909 |
| 15 | 22.307 | 24.996 | 27.488 | 30.578 | 32.801 | 37.697 |
| 20 | 28.412 | 31.410 | 34.170 | 37.566 | 39.997 | 45.315 |
| 25 | 34.382 | 37.652 | 40.646 | 44.314 | 46.928 | 52.620 |
| 30 | 40.256 | 43.773 | 46.979 | 50.892 | 53.672 | 59.703 |
How to Do a Chi-Square Test on a TI-84
χ² test of independence (χ²-Test)
- Press 2nd x⁻¹ (MATRIX), go to EDIT, choose 1:[A] and set its size to rows × columns.
- Type the observed counts row by row.
- Press STAT, go to TESTS, choose C:χ²-Test. Observed: [A], Expected: [B].
- Choose Calculate. The calculator shows χ², p and df, and stores the expected counts in [B].
χ² goodness of fit (χ²GOF-Test)
- Press STAT 1:Edit. Put the observed counts in L1 and the expected counts (not proportions) in L2.
- Press STAT, go to TESTS, choose D:χ²GOF-Test. Observed: L1, Expected: L2, df: k − 1.
- Choose Calculate to see χ², p, df and the CNTRB list of contributions. χ²GOF-Test needs a TI-84 Plus OS 2.30 or later; the TI-83 does not have it.
For a p-value only, use 2nd VARS χ²cdf(lower, 1E99, df). Practice on our TI-84 Plus CE calculator online.
Assumptions: Expected Counts, Yates and Fisher
- Counts, not percentages. Enter raw frequencies. Percentages or means give wrong answers.
- Independent observations. Each person or item belongs in exactly one cell.
- Expected counts of at least 5. A common rule is that all expected counts are ≥ 1 and no more than 20% are below 5. The calculator flags low cells for you.
- Yates continuity correction subtracts 0.5 from each |O − E| in a 2 × 2 table. It is more conservative. The TI-84 does not apply it, so leave it off to match your calculator.
- Fisher’s exact test is shown automatically for 2 × 2 tables of whole numbers. Use it when expected counts are small.
Effect Size: Cramér’s V
A small p-value says an association exists, not how strong it is. Cramér’s V = √(χ² / (n · (min(r, c) − 1))) runs from 0 (no association) to 1 (perfect association). For a 2 × 2 table it equals the phi coefficient. As a rough guide with df* = 1: 0.1 is small, 0.3 medium and 0.5 large. The calculator labels the size for your table.
Why This Chi-Square Calculator Is Different
- All three chi-square tools in one place: independence, goodness of fit, and p-value or critical value from χ².
- Paste a whole table from a spreadsheet, up to 12 × 12, with optional row and column labels.
- Goodness of fit accepts expected counts, proportions, percentages or ratios like 9:3:3:1, and rescales them to your total.
- Expected-count table with a heat map of each cell’s contribution plus adjusted residuals, so you can see which cells drive the result.
- Cramér’s V, Yates correction and Fisher exact p-value for 2 × 2 tables, with automatic low-expected-count warnings.
- Shaded chi-square curve, step-by-step working, a plain-English conclusion and TI-84 keystrokes with the exact screen output.
- Checked against SciPy on more than 11,000 values. Share links, dark mode and a phone-friendly layout. See all tools on the math and statistics calculators page, or run z and t tests with the hypothesis test calculator.
Chi-Square Calculator FAQ
Ti84CalcPro is not affiliated with or endorsed by Texas Instruments. TI-84 Plus CE is a trademark of Texas Instruments.