Chi squared test calculator for two-by-two tables
On this page

The calculator

Enter the four counts in the four boxes and select 'Calculate'.
If the minimum expected number is at least 1, you will be given the two-sided P value.
Otherwise you will be advised to use the Fisher-Irwin test.


If required, a Fisher-Irwin test can be carried out via the GraphPad calculator: Click here.

Which version of the chi squared test

This calculator uses the 'N - 1' chi squared test.

This is very similar to K. Pearson's chi squared test, but with (N - 1) rather than N in the chi squared formula. Yates's adjustment for continuity is not used.

The advantage of this version is that is can be used for small total sample sizes (less than 20), where K. Pearson's chi squared test cannot be used. For large sample sizes, it gives very similar results to K. Pearson's chi squared test.

More details are available from
  • this website
  • the following research article: Campbell Ian, 2007, Chi-squared and Fisher-Irwin tests of two-by-two tables with small sample recommendations, Statistics in Medicine, 26, 3661 - 3675 . This is available from:
or by emailing the author.

Calculation of the 'N - 1' chi squared test using SPSS

Bruce Weaver of Lakehead University, Ontario (in association with his colleagues, Sacha Dubois and Ray Koopman) has pointed out that the 'N - 1' chi squared test can be computed using SPSS by taking the Linear-by-Linear Association Chi-Square which is one of the statistics computed by the SPSS CROSSTABS procedure. This is equivalent to the 'N - 1' chi squared test. See this link to Bruce Weaver's explanation.

Back to top