Chi-Square Test of Independence Calculator

The chi-square (χ²) test of independence checks whether two categorical variables are associated, for example gender and whether students use online learning (yes/no). Paste your table of counts and the calculator shows observed and expected counts, χ², degrees of freedom, the p-value, Cramér’s V and a warning if expected counts are too small.

How to use this calculator

  1. Build a crosstab of counts (not percentages): one variable in rows, the other in columns.
  2. Copy the table from Excel, including row and column labels if you like, and paste it.
  3. Click Calculate.
  4. Check the note under the table: expected counts should be at least 5 in most cells.
  5. Copy the APA sentence.

Formula

Eᵢⱼ = (row total × column total) / N
χ² = Σ (O − E)² / E
df = (rows − 1)(columns − 1)
Cramér's V = √[χ² / (N · (min(rows, columns) − 1))]

Step-by-step example

  1. 100 students: Male 30 yes / 20 no, Female 18 yes / 32 no.
  2. Expected counts: 24 and 26 in each row.
  3. χ²(1, N = 100) = 5.77, p = .016.
  4. Cramér’s V = .24 (a small-to-medium association).

How to interpret the results

If p is below .05, the two variables are associated: the distribution of one depends on the other. Compare observed and expected counts to see where the association comes from (cells where observed is much higher than expected). Cramér’s V shows the strength: for a 2×2 table about .10 is small, .30 medium and .50 large.

How to report it in APA 7 style

A chi-square test of independence showed a significant association between gender and use of online learning, χ²(1, N = 100) = 5.77, p = .016, Cramér’s V = .24.

Statistical symbols (t, F, p, r, M, SD, N, d) should be italicised in your thesis.

Assumptions

  • Both variables are categorical.
  • Each participant is counted in only one cell (independent observations).
  • Expected counts are 5 or more in at least 80% of cells and none is below 1; for small 2×2 tables use Fisher’s exact test.
  • Data are frequencies (counts), not percentages or means.

How to do it in SPSS, R or Excel

SPSS: Analyze → Descriptive Statistics → Crosstabs → Statistics → Chi-square, Phi and Cramér’s V. R: chisq.test(table, correct = FALSE). Excel: =CHISQ.TEST(observed, expected).

Roman Urdu mein khulasa

Chi-square test check karta hai ke do categorical variables (jaise gender aur haan/nahi jawab) aapas mein jure hue hain ya nahi. Excel mein counts ki table banayein (percentages nahi) aur paste karein. p 0.05 se kam ho to association significant hai. Cramér’s V batata hai ke rishta kitna mazboot hai. Har cell ka expected count 5 ya zyada hona behtar hai.

Frequently asked questions

Can I use percentages in a chi-square test?

No. The chi-square test needs raw counts (frequencies). Convert percentages back to counts before pasting.

What if some expected counts are below 5?

If more than 20% of cells have expected counts below 5, the chi-square approximation is unreliable. For 2×2 tables use Fisher’s exact test, or merge categories in larger tables.

Does this calculator apply Yates’ continuity correction?

No. It reports the Pearson chi-square without continuity correction, which matches the first row of SPSS output. Yates’ correction is conservative and less recommended today.

What is Cramér’s V?

Cramér’s V is an effect size for chi-square that ranges from 0 (no association) to 1 (perfect association). For 2×2 tables it equals the absolute value of phi.

What is the difference between chi-square independence and goodness of fit?

The test of independence compares two categorical variables in a crosstab. The goodness-of-fit test compares one variable’s observed counts against expected proportions.

How do I report chi-square in APA?

Write χ²(df, N = total) = value, p = value, followed by the effect size, e.g. χ²(1, N = 100) = 5.77, p = .016, Cramér’s V = .24.

Related calculators

Cite this calculator

If ScholarCalc helped your analysis, you can cite it in APA 7 format:

ScholarCalc. (2026). Chi-Square Test of Independence Calculator [Web application]. https://scholarcalc.com/chi-square-calculator/

Written and maintained by the ScholarCalc team. Last reviewed: November 2026.

Accuracy: results are computed in your browser and were validated against Python scipy, statsmodels and pingouin on test datasets. See Methodology and accuracy.