Chi-Square Calculator: Goodness of Fit & Independence

Free chi-square calculator: goodness-of-fit for genetic ratios like 3:1 and 9:3:3:1, and contingency-table tests of independence, with df, p-value and steps.

Run a chi-square test in seconds. Check whether genetic cross results fit a 3:1 or 9:3:3:1 ratio with the goodness-of-fit test, or test two variables for independence with a contingency table. You get the expected values, χ², degrees of freedom, the p-value and a plain-English conclusion.

One category per line. The last number is the expected ratio or expected count (choose below).
Advertisement

Chi-square formulas

χ² = Σ (O − E)² / E Goodness of fit df = categories − 1, E = total × ratio share Independence df = (rows − 1) × (columns − 1) E = row total × column total / grand total

Worked example: Mendel’s dihybrid cross

Mendel counted 315 round yellow, 108 round green, 101 wrinkled yellow and 32 wrinkled green peas (556 in total). For a 9:3:3:1 ratio the expected counts are 312.75, 104.25, 104.25 and 34.75. χ² = 0.016 + 0.135 + 0.101 + 0.218 = 0.47 with 3 degrees of freedom. That is far below the critical value of 7.815, so the results fit the 9:3:3:1 ratio (p ≈ 0.93).

Chi-square critical values

dfα = 0.10α = 0.05α = 0.01
12.7063.8416.635
24.6055.9919.210
36.2517.81511.345
47.7799.48813.277
59.23611.07015.086
610.64512.59216.812

Common genetic ratios

CrossExpected ratiodf
Monohybrid F2 (complete dominance)3:11
Monohybrid test cross1:11
Incomplete dominance F21:2:12
Dihybrid F29:3:3:13
Dihybrid test cross1:1:1:13
Advertisement

Frequently asked questions

What does the chi-square test tell you?

Whether the difference between what you observed and what you expected is bigger than chance alone would explain.

How do I find degrees of freedom?

For goodness of fit, df = number of categories − 1. For a contingency table, df = (rows − 1) × (columns − 1).

What p-value is significant?

Usually p ≤ 0.05. Then you reject the null hypothesis. If p is above 0.05, the data fit the expected values.

Can I enter a ratio instead of expected numbers?

Yes. Choose “Expected ratio” and type 9, 3, 3 and 1 (or 3 and 1). The calculator scales the ratio to your total.

When should I not use chi-square?

When expected counts are below 5 in many categories, or when you have percentages instead of raw counts. Always use counts.

Related tools

Free educational tool by HawkInc. Results are calculated in your browser and rounded for display; check critical work by hand or with a second method.