Chi-Square Test of Independence Calculator

Enter observed frequencies into a contingency table (up to 5×5) and get your Chi-Square statistic, p-value, and degrees of freedom back. Set your significance level (α), fill in the observed counts for each cell, and the calculator determines whether a statistically significant association exists between your two categorical variables. Results include Cramér's V effect size and a breakdown of expected frequencies.

Number of categories for the row variable

Number of categories for the column variable

Threshold for statistical significance

Results

Chi-Square Statistic (χ²)

--

P-Value

--

Degrees of Freedom

--

Cramér's V (Effect Size)

--

Total Sample Size (N)

--

Result

--

Observed vs Expected Frequencies by Cell

Results Table

Frequently Asked Questions

What is the Chi-Square Test of Independence?

The Chi-Square Test of Independence is a statistical test used to determine whether two categorical variables are associated or independent of each other. It compares the observed frequencies in a contingency table to the frequencies you'd expect if there were no relationship between the variables. A significant result (p < α) suggests the variables are not independent.

What is a contingency table?

A contingency table (also called a cross-tabulation or crosstab) displays the frequency distribution of two categorical variables simultaneously. Rows represent categories of one variable and columns represent categories of another. Each cell contains the count of observations that fall into that combination of categories.

How do I interpret the p-value?

The p-value represents the probability of observing a chi-square statistic as extreme as yours — or more extreme — if the two variables were truly independent. If p < α (e.g., 0.05), you reject the null hypothesis and conclude there is a statistically significant association between the variables. If p ≥ α, you fail to reject the null hypothesis and conclude there is insufficient evidence of an association.

What are degrees of freedom in a Chi-Square test?

Degrees of freedom (df) for the test of independence is calculated as (number of rows − 1) × (number of columns − 1). For a 2×2 table, df = 1. Degrees of freedom determine which chi-square distribution is used to calculate the p-value — a larger df shifts the critical value higher.

What is Cramér's V and how do I interpret it?

Cramér's V is a measure of the strength of association between two categorical variables, ranging from 0 (no association) to 1 (perfect association). As a rough guide: V ≈ 0.1 is a small effect, V ≈ 0.3 is a medium effect, and V ≈ 0.5 or above is a large effect. Unlike the chi-square statistic, Cramér's V is not affected by sample size, making it useful for comparing effect sizes across studies.

What are the assumptions of the Chi-Square test?

Key assumptions include: (1) observations are independent of each other, (2) each observation falls into exactly one cell, (3) the expected frequency in each cell should be at least 5 for the approximation to be reliable. If expected frequencies are too small, consider combining categories or using Fisher's Exact Test instead.

What is the difference between the Chi-Square Goodness of Fit test and the Test of Independence?

The Goodness of Fit test compares observed frequencies for a single categorical variable against a theoretical distribution. The Test of Independence examines whether two categorical variables measured on the same sample are associated. This calculator performs the Test of Independence using a contingency table with two variables.

How large does my sample need to be?

There is no strict minimum total sample size, but the rule of thumb is that every cell's expected frequency should be at least 5. If your table has cells with expected counts below 5, the chi-square approximation becomes unreliable. In those cases, you may want to merge categories or use an exact test. For a 2×2 table, a minimum N of around 20–30 is generally recommended.

More Statistics Tools