Home › Biology, Earth & Space › Punnett Square Calculator
Punnett Square Calculator
Builds the Punnett square for a one-gene (monohybrid) or two-gene (dihybrid) cross from the parents' genotypes and reports the offspring genotype and phenotype ratios, assuming complete dominance and independent assortment.
When to use
You need the expected offspring ratios (e.g. 3 : 1 or 9 : 3 : 3 : 1), genotype probabilities or the full grid for a Mendelian cross written with allele letters such as Aa × Aa or AaBb × AaBb.
Do not use when: Genes are linked, sex-linked, codominant or incompletely dominant, polygenic or have more than two alleles, or you need allele frequencies in a population (use hardy-weinberg).
Formula
Gametes = every combination of one allele per gene; offspring genotype = one gamete from each parent; P(genotype) = cells with that genotype / total cells; phenotype (complete dominance) = dominant when at least one upper-case allele is present for the gene
Mendelian inheritance with complete dominance, independent assortment (unlinked genes) and equal gamete frequencies; the ratios are expected probabilities, not guaranteed counts in a small litter.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
parent_1 | string | yes | Genotype of the first parent as allele letters, two per gene: upper case = dominant, lower case = recessive (Aa, AA, aa, AaBb, AABb). One or two genes. | |
parent_2 | string | yes | Genotype of the second parent with the same gene letters as parent_1. |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
genotype_ratios | list | One row per offspring genotype: genotype, count (cells of the square), fraction and percent. | |
phenotype_ratios | list | One row per phenotype under complete dominance (A_ = shows the dominant trait, aa = recessive): phenotype, description, count, fraction, percent. | |
ratio_text | string | Reduced genotype ratio in the order of genotype_ratios, e.g. 1 : 2 : 1. | |
phenotype_ratio_text | string | Reduced phenotype ratio in the order of phenotype_ratios, e.g. 3 : 1 or 9 : 3 : 3 : 1. | |
gametes_parent_1 | string_list | Possible gametes of parent 1 (2 for one gene, 4 for two genes; repeated when the parent is homozygous). | |
gametes_parent_2 | string_list | Possible gametes of parent 2. | |
grid | list | One row per cell of the square (row-major): parent_1_gamete, parent_2_gamete, offspring genotype and phenotype; 4 cells for one gene, 16 for two. | |
total_cells | integer | 4 (monohybrid) or 16 (dihybrid); every cell is equally likely. |
Example
Monohybrid Aa × Aa: {"parent_1":"Aa","parent_2":"Aa"} → {"genotype_ratios":[{"genotype":"AA","count":1,"fraction":0.25,"percent":25},{"genotype":"Aa","count":2,"fraction":0.5,"percent":50},{"genotype":"aa","count":1,"percent":25}],"ratio_text":"1 : 2 : 1","phenotype_ratio_text":"3 : 1","total_cells":4}
Dihybrid AaBb × AaBb: {"parent_1":"AaBb","parent_2":"AaBb"} → {"phenotype_ratio_text":"9 : 3 : 3 : 1","ratio_text":"1 : 2 : 1 : 2 : 4 : 2 : 1 : 2 : 1","phenotype_ratios":[{"phenotype":"A_ B_","count":9,"percent":56.25},{"phenotype":"A_ bb","count":3},{"phenotype":"aa B_","count":3},{"phenotype":"aa bb","count":1,"percent":6.25}],"total_cells":16}
GET https://tttkmbb.com/api/v1/calculate/punnett-square?parent_1=Aa&parent_2=Aa
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/punnett-square(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/punnett-square · Markdown: https://tttkmbb.com/science/punnett-square.md · JSON definition: https://tttkmbb.com/science/punnett-square.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="punnett-square" - OpenAPI operationId:
calculate_punnett_square - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Punnett square (reference)
- OpenStax Biology 2e – 12.2 Characteristics and Traits (textbook)
FAQ
How do I write the genotypes?
Two letters per gene, upper case for the dominant allele: Aa is heterozygous, AA homozygous dominant, aa homozygous recessive; for two genes write them back to back (AaBb). Both parents must use the same gene letters.
Why is the square 2×2 for AA × Aa instead of 1×2?
Every gamete of each parent is listed, so a homozygous parent contributes two identical gametes; the ratios are the same either way (here 1 : 1 AA to Aa).
What does A_ mean?
A phenotype label: at least one dominant allele (AA or Aa), so the dominant trait is shown; aa shows the recessive trait.
Related calculators
- Hardy-Weinberg Equilibrium Calculator — Allele and genotype frequencies in a whole population instead of one cross.
- Probability of Two Events Calculator — Combine the offspring probabilities with other independent events.
- Combinations and Permutations Calculator — Count the possible gamete combinations for more genes.