# 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.

- Calculator id: `punnett-square` · Category: Biology, Earth & Space (`science`) · Tool name: `calculate_punnett_square`
- Canonical page: https://tttkmbb.com/science/punnett-square · This document: https://tttkmbb.com/science/punnett-square.md · JSON definition: https://tttkmbb.com/science/punnett-square.json

## Purpose

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.

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `parent_1` | string |  | required | 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 |  | required | Genotype of the second parent with the same gene letters as parent_1. |

## Output

| Field | 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. |

## 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.

## Data Sources

- Wikipedia – Punnett square — https://en.wikipedia.org/wiki/Punnett_square (reference, retrieved 2026-09-24)
- OpenStax Biology 2e – 12.2 Characteristics and Traits — https://openstax.org/books/biology-2e/pages/12-2-characteristics-and-traits (textbook, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/punnett-square?parent_1=…&parent_2=…`
- `POST https://tttkmbb.com/api/v1/calculate/punnett-square` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/punnett-square · OpenAPI operationId `calculate_punnett_square` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "punnett-square", "inputs": {…}}`

## Example

- Monohybrid Aa × Aa: inputs `{"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: inputs `{"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
```

## Limitations

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). 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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Hardy-Weinberg Equilibrium Calculator](https://tttkmbb.com/science/hardy-weinberg.md) — Allele and genotype frequencies in a whole population instead of one cross.
- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Combine the offspring probabilities with other independent events.
- [Combinations and Permutations Calculator](https://tttkmbb.com/math/combinations-permutations.md) — Count the possible gamete combinations for more genes.
