Statistics & probability

Chi square contingency independence calculator

Calculate Pearson independence evidence for rectangular count tables, with expected cells, residual contributions, sparse-cell counts and Cramér’s V.

Your numbers

No thousands separators; use the units stated in the label

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Try it, understand it

Explore the result

Use observed margins to build an independence model for every cell. Add Pearson contributions, use (rows−1)(columns−1) degrees of freedom and report the chi-square approximation separately from residual diagnostics.

Worked example comparison
ExampleOutputWhat to notice
Worked examplePearson chi-square statistic6.666667For rows [10,20] and [20,10], every expected count is 15. Four contributions of 25/15 sum to χ² = 6.666667 with one degree of freedom.
Exact independencePearson chi-square statistic0Observed counts equal expectations and χ² is zero.
Three columnsPearson chi-square statistic6.666667The expected table and degrees of freedom expand.

Check your understanding

Can I paste percentages?

Use observed whole counts rather than percentages.

Is Yates correction applied?

No, this is uncorrected Pearson chi-square.

Behind the numbers

How this calculation works

Use observed margins to build an independence model for every cell. Add Pearson contributions, use (rows−1)(columns−1) degrees of freedom and report the chi-square approximation separately from residual diagnostics.

THE FORMULAExpected cell = row total × column total / grand total; χ² = sum((observed − expected)² / expected)

A worked example

For rows [10,20] and [20,10], every expected count is 15. Four contributions of 25/15 sum to χ² = 6.666667 with one degree of freedom.

Good to know

Uncorrected Pearson count-data approximation. No paired-data test, Yates correction, survey weights, structural zeros or causality claim. Sparse expected counts can invalidate the approximation.

Enter counts rather than percentages

The test’s reference distribution depends on the amount of information represented by actual counts. Replacing a count table with percentages while retaining the same pattern changes its implied sample size.

Every row and column needs a positive marginal total. Empty categories can be removed only when doing so is appropriate for the study, not merely to manipulate an output.

The fisher exact two by two calculator adds enumerate fixed-margin 2×2 tables for Fisher’s test, exposing the selected one-sided or probability-ordered two-sided tail and sample odds ratio.

Residuals localize the discrepancy

Expected counts summarize the independence model. Pearson residuals divide observed-minus-expected differences by the square root of the corresponding expected count.

The squared residuals add to the test statistic. A large residual identifies a cell contributing to the mismatch, but this page does not adjust cell-by-cell inferences for multiple comparisons.

An approximation has conditions

The number of expected cells below five is shown as a diagnostic. It is not a universal automatic pass/fail rule, and it does not replace checking the design and expected-count distribution.

Cramér’s V provides a descriptive effect-size summary. Neither it nor the global p value identifies a causal relationship or proves that categories were sampled independently.

Use the result with the next measurement

The Fisher exact two by two calculator uses fixed-margin hypergeometric probabilities for a 2×2 table. Its exact conditional convention differs from this large-sample chi-square approximation.

Uncorrected Pearson count-data approximation. No paired-data test, Yates correction, survey weights, structural zeros or causality claim. Sparse expected counts can invalidate the approximation.

A few questions, answered

Can I paste percentages?

Use observed whole counts rather than percentages.

Is Yates correction applied?

No, this is uncorrected Pearson chi-square.

Do sparse-cell counts certify validity?

No, they are diagnostics only.

Find your calculator

Start typing to explore the library.