Chi Square Calculator
Free Chi square Calculator for biostatistics. Enter variables to compute results with formulas and detailed steps. Get results you can export or share.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Chi Square Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: χ² = Σ[(Oᵢ - Eᵢ)² / Eᵢ] | df = k - 1 (goodness-of-fit)
Worked example — χ² = 13.80, p ≈ 0.001 — Significant (not fair)
Formula
χ² = Σ[(Oᵢ - Eᵢ)² / Eᵢ] | df = k - 1 (goodness-of-fit)
Chi-square goodness-of-fit test compares observed frequencies to expected frequencies. Large χ² means observed differs significantly from expected. If no expected values given, assumes equal distribution.
Worked Examples
Example 1: Dice fairness test
Problem:Roll dice 100 times: 50, 30, 20 for three outcomes (expected: 33.3 each)
Solution:χ² = (50-33.3)²/33.3 + (30-33.3)²/33.3 + (20-33.3)²/33.3 = 13.80
Result:χ² = 13.80, p ≈ 0.001 — Significant (not fair)
Frequently Asked Questions
When do I use the chi-square test?
Use chi-square for: (1) Goodness-of-fit: observed frequencies match expected distribution? (2) Independence: are two categorical variables related? Requires expected counts ≥ 5 per cell.
What is the difference between chi-square goodness-of-fit and chi-square test of independence?
The goodness-of-fit test uses a single sample and one categorical variable to test whether observed frequencies match a theoretically expected distribution, such as testing if a die is fair. The test of independence uses a two-way contingency table with two categorical variables from the same sample and tests whether the two variables are associated with each other, such as whether smoking status is associated with disease outcome. Both tests use the same chi-square formula but have different degrees of freedom calculations and different research questions.
How do I interpret a chi-square p-value?
The p-value in a chi-square test represents the probability of observing a chi-square statistic at least as extreme as the one calculated, assuming the null hypothesis is true. A p-value below your significance level (typically 0.05) means you reject the null hypothesis. For a goodness-of-fit test, rejecting the null means the data does not follow the expected distribution. For a test of independence, rejecting the null means the two variables are statistically associated. A p-value of 0.03 means there is only a 3% chance of getting such extreme results if the null were true — low enough to consider the result significant at the 5% level.
How do I use a Punnett square?
A Punnett square predicts offspring genotype ratios. Write one parent's alleles across the top and the other's down the side. Fill in each box by combining the row and column alleles. For a monohybrid cross of two heterozygotes (Aa x Aa), you get 1 AA : 2 Aa : 1 aa, or a 3:1 phenotype ratio.
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
🧮Dihybrid Cross Punnett Square Calculator
Calculate dihybrid cross punnett square with inputs, formulas, and instant results.
🧮Punnett Square Calculator: Genotype & Phenotype Odds
Calculate punnett square with inputs, formulas, and instant results.
🧮Trihybrid Cross Punnett Square Calculator
Calculate trihybrid cross punnett square with inputs, formulas, and instant results.
🧮Alpaca Gestation Calculator
Calculate alpaca gestation with inputs, formulas, and instant results.
🧮Cat Pregnancy Calculator — Due Date & Gestation
Calculate cat pregnancy with inputs, formulas, and instant results.
🧮Cow Gestation Calculator
Calculate cow gestation with inputs, formulas, and instant results.
🧮Dog Pregnancy Calculator: Due Date by Breed
Calculate dog pregnancy with inputs, formulas, and instant results.
🧮Goat Gestation Calculator
Calculate goat gestation with inputs, formulas, and instant results.