Dihybrid Cross Calculator
Cross two parents for two genes at once and instantly get gamete combinations, a fully built 4×4 Punnett square, genotype and phenotype ratios, and a clear explanation of why independent assortment produces the classic 9:3:3:1 pattern.
Background
A dihybrid cross tracks two genes at the same time — for example, seed color and seed shape in Mendel's pea plants. Because the two genes assort independently (Mendel's Law of Independent Assortment), each parent produces four types of gametes, and crossing two heterozygous parents (AaBb × AaBb) produces a 4×4 Punnett square with 16 boxes. When both genes show simple dominant/recessive inheritance, the classic phenotypic ratio that results is 9:3:3:1 — but this calculator works for any pair of genotypes, including test crosses and crosses where one or both parents aren't fully heterozygous.
How to use this calculator
- Choose a cross type: the classic heterozygous cross (AaBb × AaBb), a fully custom cross with any genotypes, or a standard test cross.
- Enter the two gene letters and the parent genotypes for each parent.
- Click Calculate Cross to see the gametes each parent produces, the full 4×4 grid, genotype and phenotype ratios, and a complete explanation.
- Use the quick example chips to instantly load classic textbook crosses, including Mendel's original pea plant cross.
How a dihybrid cross works
Step 1 — Generate gametes using FOIL. For a parent like AaBb, use First, Outer, Inner, Last (the same FOIL pattern used in algebra) to generate all 4 possible allele combinations: AB, Ab, aB, ab. Each gamete carries exactly one allele from each gene.
Step 2 — Build the 4×4 grid. Place one parent's 4 gametes across the top and the other parent's 4 gametes down the side, then fill in all 16 boxes by combining the row and column gametes.
Step 3 — Read off genotypes. Each of the 16 boxes is a genotype for the offspring, like AaBb or AAbb. Several boxes often share the same genotype.
Step 4 — Convert to phenotypes. Apply the dominance rules for each gene separately, then combine. For two simple dominant/recessive genes, this produces the classic 9:3:3:1 ratio: 9 boxes showing both dominant traits, 3 showing dominant-A/recessive-B, 3 showing recessive-A/dominant-B, and 1 showing both recessive traits.
Why 9:3:3:1? Each gene independently follows a 3:1 ratio (3 dominant : 1 recessive). Because the genes assort independently, you multiply the ratios: (3:1) × (3:1) = 9:3:3:1. This is the Product Rule of probability applied to genetics.
Formula & Equations Used
Number of unique gametes: 2ⁿ, where n = number of heterozygous gene pairs in that parent (e.g. AaBb has n=2 → 4 gametes; AABb has n=1 → 2 gametes; AABB has n=0 → 1 gamete).
Punnett square size: (gametes from Parent A) × (gametes from Parent B) total boxes.
Classic dihybrid ratio (product rule): (3 : 1) × (3 : 1) = 9 : 3 : 3 : 1 — multiplying each gene's independent 3:1 phenotype ratio together, valid only when both parents are fully heterozygous for two simple dominant/recessive genes.
Probability of a specific offspring phenotype: P(trait 1) × P(trait 2), since the two genes assort independently — e.g. P(round AND yellow) = P(round) × P(yellow) = ¾ × ¾ = 9/16.
Example Problems & Step-by-Step Solutions
Example 1 — Mendel's classic pea cross
Cross RrYy (round, yellow) × RrYy (round, yellow), where R = round (dominant), r = wrinkled, Y = yellow (dominant), y = green.
Step 1: Both parents produce 4 gametes each: RY, Ry, rY, ry.
Step 2: The 4×4 grid produces 16 genotype combinations.
Result: Phenotype ratio is 9 round/yellow : 3 round/green : 3 wrinkled/yellow : 1 wrinkled/green — the classic 9:3:3:1 ratio Mendel observed.
Example 2 — Test cross
Cross RrYy × rryy. The rryy parent produces only 1 gamete type: ry.
Step 1: RrYy produces 4 gamete types (RY, Ry, rY, ry); rryy produces only ry.
Step 2: All 16 boxes receive "ry" from one parent, so the offspring phenotypes directly reveal the genotype of the heterozygous parent.
Result: Phenotype ratio is 1:1:1:1 — this is exactly why test crosses are used to determine unknown genotypes.
Example 3 — One gene homozygous
Cross AABb × AaBb. The "AA" parent can only pass on the A allele for that gene.
Step 1: AABb produces gametes AB, Ab (only 2 types, since A is fixed). AaBb produces AB, Ab, aB, ab (4 types).
Step 2: No offspring can be "aa" for the first gene, since one parent never contributes a lowercase a.
Result: Phenotype ratio collapses to 3:1 for the first gene combined with the normal 3:1 ratio for the second gene — giving an overall 3:1 split for gene 2 across all gene-1-dominant offspring (effectively 3:1, not 9:3:3:1, because gene A no longer varies).
Example 4 — Both parents fully homozygous
Cross AABB (fully dominant) × aabb (fully recessive).
Step 1: AABB produces only 1 gamete type: AB. aabb produces only 1 gamete type: ab.
Step 2: Every offspring in the 4×4 grid (really just 1 unique box, repeated 16 times) is AaBb.
Result: 100% of offspring are AaBb, showing both dominant phenotypes — this is the F1 generation Mendel started with before doing the F1 × F1 classic cross.
Frequently Asked Questions
Why does AaBb produce 4 gametes instead of 2?
Each gamete needs exactly one allele from each gene. Since there are 2 choices for the first gene (A or a) and 2 choices for the second gene (B or b), and the genes assort independently, there are 2 × 2 = 4 possible combinations: AB, Ab, aB, ab. This is the Fundamental Counting Principle applied to independent assortment.
Why is the ratio always 9:3:3:1 for two heterozygous parents?
It isn't always — that ratio only appears when both genes follow simple dominant/recessive inheritance and both parents are fully heterozygous (AaBb × AaBb). It comes from multiplying each gene's independent 3:1 ratio together: (3:1) × (3:1) = 9:3:3:1. If a parent isn't fully heterozygous, or if a gene shows codominance or epistasis, the ratio changes — which is exactly what this calculator's other modes show.
What's the difference between a genotype ratio and a phenotype ratio?
The genotype ratio counts the exact allele combinations (like AABB, AaBb, aabb) — for AaBb × AaBb, this is actually 1:2:1:2:4:2:1:2:1 across 9 unique genotypes. The phenotype ratio groups genotypes by their visible trait (since AA and Aa both look "dominant"), simplifying that same cross down to 9:3:3:1.
Why are test crosses always done with a homozygous recessive parent?
A homozygous recessive parent (aabb) can only contribute recessive alleles, so it can't mask anything. Whatever phenotype shows up in the offspring directly reflects the allele the other parent contributed — making it possible to determine whether an organism with a dominant phenotype is actually homozygous dominant or heterozygous.
Does this work if the two genes are on the same chromosome (linked)?
No — this calculator assumes independent assortment, which requires the two genes to be on different chromosomes (or far apart on the same one). If genes are linked, gametes aren't produced in equal 1:1:1:1 proportions, and you'd need recombination frequency data and a genetic linkage calculator instead.
What if a trait shows incomplete dominance instead of simple dominance?
This calculator assumes classic Mendelian dominant/recessive inheritance for both genes. With incomplete dominance or codominance, heterozygotes show a third, intermediate or blended phenotype rather than just looking like the dominant homozygote — which changes the phenotype ratio away from the standard 9:3:3:1 pattern even with two fully heterozygous parents.