How to use (3 steps)
- Select a ratio preset (3:1, etc.) or enter a custom ratio.
- Enter observed counts for each category (use an example to start quickly).
- Results (χ², p-value, expected counts, charts) appear; with auto update on, they refresh as you type.
Results are guides. Check contributions and charts together.
Inputs (ratio & observed counts)
Results (χ² & p-value)
—
Observed vs expected (table & charts)
| Category | Observed | Expected | O−E | Contribution | Pearson residual | Ratio |
|---|
Observed vs expected
Contribution
How it’s calculated
- From total N and ratio r, compute expected counts (Ei = N · ri / Σr).
- Compute χ² = Σ (Observed − Expected)² / Expected.
- Degrees of freedom df = number of categories − 1 (assuming the ratio is fixed).
- The p-value is the upper-tail probability of the χ² distribution (P(Χ² ≥ χ²)).
- (Optional) For df=1 (2 categories), you can apply Yates continuity correction (guide).
“Guide” on this calculator is not a definitive judgement. Review assumptions (e.g., how categories are grouped) as needed.
When to use Mendelian chi-square
Use this page when you already have observed offspring counts and want to test whether they are close to a fixed Mendelian ratio such as 3:1 or 9:3:3:1. It is the right next step after a Punnett square predicts the expected ratio and before you discuss whether sampling noise is large enough to explain the mismatch.
Recommended workflow
- Choose the expected ratio that matches your cross design.
- Enter observed counts for each phenotype or genotype class.
- Check the contribution column to see which class drives most of the χ² value.
- Review small expected-count warnings before you treat the p-value as reliable.
Common interpretation limits
- This page tests fit to a ratio. It does not estimate allele frequencies for a population.
- If categories were merged after seeing the data, the reported p-value can be misleading.
- Very small expected counts can make the χ² approximation rough even when the math is correct.
How this genetics page differs from the others
- Punnett square builds the expected ratio for one cross.
- Mendelian chi-square tests whether observed offspring counts still fit that fixed ratio.
- Hardy-Weinberg works from allele frequencies in a population sample, not from one planned cross.
- Wright-Fisher models how allele frequencies can drift over many generations.
FAQ
What if expected counts are small?
Small expected counts can make the χ² approximation rough. This calculator shows a warning (guide).
Does p<0.05 mean it does not fit?
It is a common guideline, but interpretation depends on context. We show it as a reference only.
What should I enter for category names?
Anything is fine (e.g., dominant/recessive, AA/Aa/aa). It works even if blank.
Does the share URL include data?
You can choose to include or exclude it. Data stays in your browser and is not sent.
Where are observed data sent?
All calculations run in your browser. Inputs are not sent anywhere.
What to compare next
If you are still building the expected ratio, start with a Punnett square. If you need population-level expected genotype frequencies instead of a single cross ratio, switch to the Hardy-Weinberg calculator. If you want to model how allele frequencies drift across generations, move to Wright-Fisher.
Related tools
- Punnett square generatorBuild the expected genotype and phenotype ratios for a one- or two-gene cross before testing observed counts.
- Hardy-Weinberg equilibrium calculatorEstimate expected genotype frequencies from allele frequencies and compare observed population counts.
- Genetic drift simulator (Wright-Fisher)Explore how finite population size, selection, mutation, or migration can change allele frequencies over generations.
Comments (optional)
To reduce load, comments are fetched only when needed.