Dihybrid Cross Calculator
Free dihybrid cross calculator. Enter two parent genotypes for two genes and get the 16-cell Punnett square, 9:3:3:1 ratio and expected offspring counts.
Dihybrid Cross Calculator
Background.
A dihybrid cross follows two genes at once. This calculator takes both parents' genotypes at two independently assorting genes, enumerates all sixteen cells of the 4×4 Punnett square, and returns the probability of each of the four visible classes, the reduced genotype and phenotype ratios, and the expected number of offspring in each class for a progeny total you choose.
The defining result is the 9:3:3:1 phenotypic ratio. Cross two double heterozygotes — AaBb × AaBb — and 56.25 % of offspring show the dominant phenotype at both genes, 18.75 % are dominant at the first and recessive at the second, 18.75 % are recessive at the first and dominant at the second, and 6.25 % are recessive at both. Underneath, nine distinct genotypes appear in the 1:2:1:2:4:2:1:2:1 pattern, because a 1:2:1 monohybrid ratio at one gene multiplied by a 1:2:1 at the other gives nine combinations.
That multiplication is the whole idea, and it is why the page also reports gamete counts. Mendel's second law — independent assortment — says the allele a gamete receives at one gene tells you nothing about the allele it receives at the other. A parent heterozygous at both genes therefore makes four genetically different gametes in equal numbers, a parent heterozygous at one gene makes two, and a double homozygote makes one. Two parents making four gametes each produce a sixteen-cell grid, and every cell is equally likely, so each probability is an exact sixteenth. You can shortcut the whole grid with the product rule: P(A_) = 3/4 and P(B_) = 3/4, so P(A_B_) = 3/4 × 3/4 = 9/16. The calculator enumerates the grid and its test suite checks the answer against that multiplication, so the two routes are known to agree.
The expected-count outputs exist because a dihybrid ratio is almost always the setup for a statistical test rather than the end of the problem. Enter your real progeny total and you get the expectations a chi-square goodness-of-fit test needs. They are reported unrounded on purpose: Mendel's famous 556 seeds give expectations of 312.75, 104.25, 104.25 and 34.75, and rounding those to whole seeds changes the resulting chi-square value. His observed counts were 315 round yellow, 108 round green, 101 angular yellow and 32 angular green, which gives χ² = 0.470 on three degrees of freedom against a 5 % critical value of 7.815 — a very comfortable fit.
The honest limits belong here rather than at the bottom of the page. This model is exact only when the two genes assort independently, which in practice means they sit on different chromosomes or far enough apart on the same one that crossing over shuffles them freely. Genes that are physically close are linked: the combinations the parents already had turn up more often than 9:3:3:1 predicts and the recombinant ones turn up less, sometimes dramatically so. A departure from 9:3:3:1 in real data is usually evidence of linkage or of epistasis — one gene masking the other, which converts the ratio into 9:7, 12:3:1, 13:3 or 15:1 depending on the mechanism — rather than evidence that the arithmetic went wrong. Lethal alleles remove a class before it can be counted, and reduced penetrance moves individuals out of the class their genotype puts them in.
A note on Mendel's own luck is worth carrying, because the textbook version is a simplification. Introductory texts often say all seven of his traits sit on separate chromosomes. The molecular work does not support that: Reid and Ross, writing in Genetics in 2011, place the seven genes on only five of the pea's seven linkage groups, with the stem-length and pod-form genes about 12.6 map units apart on the same one — genuinely linked. Mendel appears simply not to have run a detailed dihybrid analysis on that particular pair. Below the widget you will find the full derivation, the worked example step by step, how to read a testcross, what a chi-square test does with these numbers, and where the independent-assortment assumption stops being safe.
What is dihybrid cross calculator?
A dihybrid cross is a mating tracked at two genes simultaneously, conventionally written with two letters — one per gene — such as AaBb × AaBb. Each parent carries two alleles at each gene, and under Mendel's law of independent assortment the allele passed on at one gene is chosen independently of the allele passed on at the other. A parent heterozygous at both genes therefore produces four kinds of gamete (AB, Ab, aB, ab) in equal proportions; arranging four gametes against four gametes gives the sixteen-cell Punnett square that defines the dihybrid case.
The classic result is the 9:3:3:1 phenotypic ratio, which appears whenever both parents are heterozygous at both genes and both genes show complete dominance. Nine sixteenths of offspring are dominant at both genes, three sixteenths dominant at the first and recessive at the second, three sixteenths the reverse, and one sixteenth recessive at both. Beneath that lie nine genotype classes in a 1:2:1:2:4:2:1:2:1 pattern — the product of a 1:2:1 at each gene. The underscore notation used throughout, as in A_B_, means 'either allele at that position', so A_ covers AA and Aa alike, which is exactly the ambiguity complete dominance creates.
Two other crosses are worth naming because they answer different questions. A dihybrid testcross pairs an individual of unknown genotype with a double recessive (aabb). The tester contributes only ab gametes, so every offspring's phenotype reveals directly which gamete the unknown parent supplied, and the progeny ratio is a direct readout of that parent's gamete frequencies. A 1:1:1:1 testcross result means the two genes assorted independently; anything else is the standard evidence for linkage, and the deviation is what a recombination frequency is calculated from. A cross with one homozygous parent — AABb × AaBb, say — produces fewer than nine genotype classes and a phenotype ratio other than 9:3:3:1, which this calculator handles the same way, by enumerating the grid rather than by assuming the textbook answer.
How to use this calculator.
- Write each parent's genotype as four letters: the first two are gene 1, the last two are gene 2. Uppercase is the dominant allele, lowercase the recessive one, and the two genes must use different letters — AaBb, RrYy, AABb, aabb.
- Enter parent 1 and parent 2 using the same two genes in the same order. If you enter BbAa for parent 2 after AaBb for parent 1, the calculator will ask you to reorder rather than guess.
- Set the offspring count. Leave it at 16 to read the ratio straight off the expected counts as 9, 3, 3 and 1. Set it to your real progeny total when you are preparing a chi-square test.
- Read the four phenotype percentages: dominant at both genes, dominant at gene 1 only, dominant at gene 2 only, and recessive at both. They always add to exactly 100 %.
- Use the expected counts as the E values in χ² = Σ (O − E)² / E, with three degrees of freedom for four classes. Do not round them first — the unrounded expectation is the correct one.
- Check the gamete-type counts to see how much heterozygosity each parent actually has: 4 means heterozygous at both genes, 2 at one, 1 at neither.
- For a testcross, enter aabb as parent 2. The progeny ratio then reads out parent 1's gamete frequencies directly, which is how linkage is detected and recombination frequency measured.
- For one gene use the Punnett square calculator; for three, the trihybrid cross calculator, which uses the forked-line method because a 64-cell grid is impractical to draw.
The formula.
Two rules do all the work: segregation within a gene, and independence between genes.
Segregation says a parent passes on exactly one of its two alleles at each gene, each with probability ½. Independent assortment says the choice at gene 1 carries no information about the choice at gene 2. Multiplying the two gives a parent's gamete list: allele from gene 1 (2 options) × allele from gene 2 (2 options) = four gametes, each with probability ¼. Those four are counted with multiplicity, so a parent AABb makes AB, Ab, AB, Ab — four gametes but only two distinct types, which is what the gamete-type outputs report.
Fertilisation pairs one gamete from each parent independently, so the 4 × 4 grid has 16 equally likely cells and
P(genotype g) = (cells equal to g) ⁄ 16
For AaBb × AaBb the nine genotypes appear 1, 2, 1, 2, 4, 2, 1, 2, 1 times, totalling 16.
Under complete dominance an offspring shows the dominant phenotype at a gene whenever it carries at least one uppercase allele there, so the four visible classes come out as
A_B_ = 9⁄16 = 56.25 % A_bb = 3⁄16 = 18.75 % aaB_ = 3⁄16 = 18.75 % aabb = 1⁄16 = 6.25 %
The same four numbers fall out of the product rule without any grid: P(A_) = ¾ and P(B_) = ¾ per gene, so P(A_B_) = ¾ × ¾ = 9⁄16, P(A_bb) = ¾ × ¼ = 3⁄16, and so on. The code counts cells and its tests multiply per-gene probabilities, and the two are required to agree — that is the cross-check, not a coincidence.
Expected counts scale linearly: E(class) = P(class) × offspring total. For 556 offspring the four expectations are 312.75, 104.25, 104.25 and 34.75, summing back to exactly 556.
ROUNDING STAGE. Rounding happens **only at the final return**, to ten decimal places, on values that are already exact rationals with denominator 16. Nothing is rounded part-way through, and expected counts are deliberately not rounded to whole offspring, because χ² = Σ (O − E)² / E is sensitive to that rounding: using 313 instead of 312.75 for Mendel's data changes the statistic in the third decimal place, and using rounded expectations for small classes changes it much more.
WHERE THE MODEL BREAKS. Independent assortment is a physical claim about chromosomes, not a mathematical identity. It holds when the two genes are on different chromosomes, or far enough apart on the same chromosome that crossing over separates them in half of meioses. When two genes sit close together they are linked: gametes carrying the parental allele combinations are over-represented and recombinant gametes under-represented, so the observed ratio shifts away from 9:3:3:1 toward the parental classes. Epistasis is a different failure — the genes assort independently but one masks the other's phenotype, turning 9:3:3:1 into 9:7, 12:3:1, 13:3 or 15:1 by merging visible classes. Lethal alleles delete a class outright, and reduced penetrance moves individuals into the wrong visible class. In every one of these cases the grid arithmetic is still correct; the mapping from genotype to phenotype, or the independence assumption, is what has failed.
INVALID DOMAIN. There is no singularity — the denominator is the constant 16, never a user value. The calculator rejects, field by field: a genotype that is not four letters, a gene whose two characters are different letters, both genes written with the same letter, any non-letter character, parents listing different genes or the same genes in a different order, and a negative or non-finite offspring count. An offspring count of zero is legal and returns four zero expectations.
A worked example.
Mendel's own two-character experiment, reproduced end to end. He crossed peas differing in seed shape and seed colour, self-pollinated the F1, and harvested 556 F2 seeds. Take A = round (dominant over angular/wrinkled) and B = yellow (dominant over green); the F1 plants are all AaBb, so the F2 comes from AaBb × AaBb. Each parent makes four gamete types — AB, Ab, aB, ab — which the calculator reports as 4 distinct gametes for each parent. Crossing four against four fills sixteen equally likely cells. Counting them gives nine genotype classes in the ratio 1 AABB : 2 AABb : 1 AAbb : 2 AaBB : 4 AaBb : 2 Aabb : 1 aaBB : 2 aaBb : 1 aabb, which sums to 16. Grouping those nine genotypes by what you can actually see gives the four phenotype classes: 9 cells are dominant at both genes (56.25 %), 3 are round but green (18.75 %), 3 are angular but yellow (18.75 %), and 1 is angular and green (6.25 %). The phenotype ratio output reads 9 A_B_ : 3 A_bb : 3 aaB_ : 1 aabb, and the four percentages add to exactly 100. Scaling to 556 seeds gives the expected counts: 312.75 round yellow, 104.25 round green, 104.25 angular yellow and 34.75 angular green, which add back to 556.00 exactly. Mendel's actual counts, as printed in the peer-reviewed 2016 Genetics translation of his 1866 paper, were 315 round yellow, 108 round green, 101 angular yellow and 32 angular green. Feeding those against the expectations above gives χ² = (315−312.75)²/312.75 + (108−104.25)²/104.25 + (101−104.25)²/104.25 + (32−34.75)²/34.75 = 0.0162 + 0.1349 + 0.1013 + 0.2176 = 0.470, on three degrees of freedom. The 5 % critical value is 7.815, so the fit is excellent and there is no evidence against independent assortment for this pair of genes. Notice that this only works because the expectations were not rounded first — using 313, 104, 104 and 35 instead changes the statistic. Finally, one contrast worth trying. Change parent 2 to aabb and the calculator switches to a testcross: parent 2 now makes just 1 gamete type, all four phenotype classes come out at 25 %, and the ratio becomes 1 : 1 : 1 : 1. That flat ratio is exactly what makes a testcross the standard tool for detecting linkage — any departure from 1:1:1:1 in real testcross progeny is measured directly as a recombination frequency.
Frequently asked questions.
Why is the dihybrid ratio 9:3:3:1?
How many gametes and genotypes does a dihybrid cross produce?
What is a dihybrid testcross and what does it tell you?
What happens to the ratio if the two genes are linked?
Were all of Mendel's seven traits really on separate chromosomes?
What is epistasis and how does it change the 9:3:3:1 ratio?
Why are the expected counts not whole numbers?
How do I run a chi-square test on my own dihybrid data?
Can I use a dihybrid cross to predict a human family's traits?
Does the order of the two parents matter?
References& sources.
- [1]Abbott S. & Fairbanks D. J. (2016). Experiments on Plant Hybrids by Gregor Mendel. Genetics 204(2):407–422. doi:10.1534/genetics.116.195198. Peer-reviewed modern English translation of Mendel (1866) published by the Genetics Society of America. Source for the two-character experiment — 556 seeds, 315 round yellow, 101 angular yellow, 108 round green, 32 angular green — and for the 2ⁿ / 3ⁿ / 4ⁿ series. Open access, not paywalled. Retrieved 2026-07-29.
- [2]OpenStax, Biology 2e, section 12.3 'Laws of Inheritance'. Rice University, 2018, CC BY 4.0. Independent derivation of the same result by the product rule: 'the proportion of round and yellow F2 offspring is expected to be (3/4) × (3/4) = 9/16', and the 4 × 4 Punnett square giving '16 equally likely genotypic combinations' and 'a phenotypic ratio of 9 round/yellow:3 round/green:3 wrinkled/yellow:1 wrinkled/green'. Free, openly licensed. Retrieved 2026-07-29.
- [3]Reid J. B. & Ross J. J. (2011). Mendel's genes: toward a full molecular characterization. Genetics 189(1):3–10. doi:10.1534/genetics.111.132118. Places Mendel's seven traits on only five of the seven pea linkage groups, with le and v roughly 12.6 map units apart on linkage group III, and concludes 'an element of luck was involved with his choice of characters'. This page follows Reid & Ross where it conflicts with the textbook account — see the FAQ on Mendel's chromosomes. Open access via PMC. Retrieved 2026-07-29.
- [4]OpenStax, Biology 2e, section 13.1 'Chromosomal Theory and Genetic Linkage'. Rice University, 2018, CC BY 4.0. Source for the linkage mechanism — 'linked genes disrupt Mendel's predicted outcomes' and recombination frequency correlating with genetic distance — and, in its account of Mendel's traits, the simplification this page records as conflicting with Reid & Ross (2011). Free, openly licensed. Retrieved 2026-07-29.
- [5]MedlinePlus Genetics, US National Library of Medicine. Inheritance Patterns, page last updated 19 April 2021. Source for the classical inheritance-mode definitions used in the scope statements, and for the position that most visible human traits are not single-gene. Free. Retrieved 2026-07-29.
- [6]Gulani A. & Weiler T. Genetics, Autosomal Recessive. StatPearls, NCBI Bookshelf ID NBK546620, last update 1 May 2023. Source for the per-gene 25 % / 50 % / 25 % monohybrid figures that this page multiplies together, and for the product-rule statement '50% x 50% = 25%'. Free full text. Retrieved 2026-07-29.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 682 calculators remain free
- No billing is enabled