Stats Assistance
Categorical data

Chi-Square Test Calculator with P Value

Enter your counts and get the chi-square statistic, degrees of freedom, and the exact p value. Works for tests of independence and goodness of fit.

Example above is a 2×2 table: rows are groups, columns are outcome categories. Up to 10×10 supported.

APA 7 write-up
Powered by ReliCheck Quanta

Crosstabs from a real dataset? ReliCheck Quanta builds contingency tables from raw data, checks expected cell counts, and produces APA tables automatically. Free to try on your Mac.

Get Quanta

How to calculate the p value for a chi-square test

The p value is the area in the right tail of the chi-square distribution that sits beyond your test statistic, at your degrees of freedom. Two inputs produce it: the chi-square value and df. Nothing else.

Degrees of freedom come from the shape of the data, not the sample size. For a test of independence, df = (rows − 1) × (columns − 1). For goodness of fit, df = number of categories − 1.

Worked example

Take a 2×2 table of 85 people: 30 and 12 in the first row, 18 and 25 in the second.

  1. Row totals are 42 and 43. Column totals are 48 and 37. N = 85.
  2. Each expected count is (row total × column total) ÷ N. The first cell expects 42 × 48 ÷ 85 = 23.72.
  3. For every cell, square the gap between observed and expected, then divide by expected. Add the four results: χ² = 7.56.
  4. df = (2 − 1) × (2 − 1) = 1.
  5. A chi-square of 7.56 at df = 1 gives p = .006. Below .05, so the association is statistically significant.

Run those same numbers through the calculator above and you get χ²(1, N = 85) = 7.56, p = .006, φ = .30.

Chi-square to p value reference table

Critical values below. If your chi-square statistic is larger than the value in a column, your p value is smaller than that column's threshold. A table gives you a range; the calculator gives you the exact number.

dfp = .05p = .01p = .001
13.8416.63510.828
25.9919.21013.816
37.81511.34516.266
49.48813.27718.467
511.07015.08620.515
612.59216.81222.458
714.06718.47524.322
815.50720.09026.124
916.91921.66627.877
1018.30723.20929.588

Worked from the chi-square distribution, upper tail. Reporting an exact p value is the APA 7 preference; use the table to sanity check, not to report.

Which chi-square test do I need?

Test of independence: two categorical variables, one sample. Example: is program completion (yes/no) related to enrollment status (full time/part time)? Enter the cross-tabulated counts.

Goodness of fit: one categorical variable compared against expected proportions. Example: do students choose the four majors equally often? Enter observed counts and, if the expectation is not equal shares, the expected proportions.

When the p value is not trustworthy

Effect size

A small p value tells you the association is unlikely to be chance. It does not tell you the association is large. For tests of independence the calculator reports Cramer's V (phi for 2×2 tables). Values around .10 are small, .30 medium, and .50 large for df* = 1, with thresholds shrinking as tables grow.

Report both. A p of .001 with a V of .08 is a real but trivial association, and the p value alone hides that.

Related calculators

A chi-square result gets harder to defend when expected counts are small, when the table is bigger than two by two, or when the same people appear in more than one cell. If you are unsure whether the test holds up in your design, a written review by a PhD statistician costs less than finding out at peer review.

Run every test. Keep the evening.
Every test in your spreadsheet, with the APA tables written.
Try Quanta Free