{
  "id": "punnett-square",
  "version": "7dac3039e292",
  "status": "published",
  "name": "Punnett Square Calculator",
  "question": "What does my Punnett square show?",
  "summary": "Builds the Punnett square for a monohybrid or dihybrid cross from the parents’ genotypes, with the offspring genotype and phenotype ratios and the chance of each phenotype.",
  "category": "biology",
  "subcategory": "genetics",
  "url": "https://www.acalculator.org/biology/punnett-square-calculator",
  "markdown": "https://www.acalculator.org/biology/punnett-square-calculator.md",
  "kind": "function",
  "method": "Each parent passes one allele of each gene, every gamete with equal chance; the square crosses every gamete of parent 1 with every gamete of parent 2, and each cell is one equally likely offspring.",
  "assumptions": [
    "Complete dominance: AA and Aa show the same dominant trait; only aa shows the recessive trait.",
    "With two genes, the genes assort independently (they are not linked on one chromosome).",
    "Every gamete is equally likely, and every offspring equally likely to survive."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "genes": {
        "title": "Genes",
        "description": "One gene (a monohybrid cross) or two genes (a dihybrid cross).",
        "type": "string",
        "enum": [
          "1",
          "2"
        ]
      },
      "p1a": {
        "title": "Parent 1, gene A",
        "description": "Parent 1’s two alleles of gene A; A is dominant over a.",
        "type": "string",
        "enum": [
          "AA",
          "Aa",
          "aa"
        ]
      },
      "p1b": {
        "title": "Parent 1, gene B",
        "description": "Parent 1’s two alleles of gene B; B is dominant over b.",
        "type": "string",
        "enum": [
          "BB",
          "Bb",
          "bb"
        ]
      },
      "p2a": {
        "title": "Parent 2, gene A",
        "description": "Parent 2’s two alleles of gene A.",
        "type": "string",
        "enum": [
          "AA",
          "Aa",
          "aa"
        ]
      },
      "p2b": {
        "title": "Parent 2, gene B",
        "description": "Parent 2’s two alleles of gene B.",
        "type": "string",
        "enum": [
          "BB",
          "Bb",
          "bb"
        ]
      }
    }
  },
  "outputs": {
    "genotypes": {
      "label": "Genotype ratio",
      "description": "How often each offspring genotype appears in the square, in lowest terms.",
      "format": "text"
    },
    "phenotypes": {
      "label": "Phenotype ratio",
      "description": "How often each trait combination appears; A_ means AA or Aa, which show the same dominant trait.",
      "format": "text"
    },
    "allDominant": {
      "label": "Shows every dominant trait",
      "description": "The chance an offspring shows the dominant trait of every gene (A_, or A_B_).",
      "format": "percent"
    },
    "firstOnly": {
      "label": "Shows the dominant A trait only",
      "description": "For two genes: the chance of the dominant A trait with the recessive b trait (A_bb).",
      "format": "percent"
    },
    "secondOnly": {
      "label": "Shows the dominant B trait only",
      "description": "For two genes: the chance of the recessive a trait with the dominant B trait (aaB_).",
      "format": "percent"
    },
    "allRecessive": {
      "label": "Shows every recessive trait",
      "description": "The chance an offspring shows the recessive trait of every gene (aa, or aabb).",
      "format": "percent"
    },
    "gametes": {
      "label": "Gametes",
      "description": "The gametes each parent can pass on, each with equal chance.",
      "format": "text"
    },
    "square": {
      "label": "Punnett square",
      "description": "Each row of the square: a gamete of parent 1 crossed with every gamete of parent 2.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "genes": "1",
      "p1a": "Aa",
      "p1b": "Bb",
      "p2a": "Aa",
      "p2b": "Bb"
    },
    "outputs": {
      "genotypes": "1 AA : 2 Aa : 1 aa",
      "phenotypes": "3 A_ : 1 aa",
      "allDominant": 75,
      "allRecessive": 25,
      "gametes": "Parent 1: A, a; parent 2: A, a",
      "square": "A × (A, a): AA, Aa; a × (A, a): Aa, aa"
    },
    "text": "Crossing these parents gives phenotypes 3 A_ : 1 aa and genotypes 1 AA : 2 Aa : 1 aa."
  },
  "examples": [
    {
      "given": {
        "genes": "1",
        "p1a": "Aa",
        "p2a": "Aa"
      },
      "expect": {
        "genotypes": "1 AA : 2 Aa : 1 aa",
        "phenotypes": "3 A_ : 1 aa",
        "allDominant": 75,
        "allRecessive": 25,
        "square": "A × (A, a): AA, Aa; a × (A, a): Aa, aa"
      },
      "source": "OpenStax, Biology 2e, section 12.2 Characteristics and Traits (Punnett square; a monohybrid Yy × Yy cross gives 1 YY : 2 Yy : 1 yy and 3 yellow : 1 green; the test cross), https://openstax.org/books/biology-2e/pages/12-2-characteristics-and-traits, retrieved 2026-10-02"
    },
    {
      "given": {
        "genes": "1",
        "p1a": "Aa",
        "p2a": "aa"
      },
      "expect": {
        "genotypes": "1 Aa : 1 aa",
        "phenotypes": "1 A_ : 1 aa",
        "allDominant": 50
      },
      "source": "OpenStax, Biology 2e, section 12.2 Characteristics and Traits (Punnett square; a monohybrid Yy × Yy cross gives 1 YY : 2 Yy : 1 yy and 3 yellow : 1 green; the test cross), https://openstax.org/books/biology-2e/pages/12-2-characteristics-and-traits, retrieved 2026-10-02; the test cross of a heterozygote gives 1 : 1"
    },
    {
      "given": {
        "genes": "1",
        "p1a": "AA",
        "p2a": "aa"
      },
      "expect": {
        "genotypes": "1 Aa",
        "phenotypes": "1 A_",
        "allDominant": 100,
        "allRecessive": 0
      },
      "source": "OpenStax, Biology 2e, section 12.2 Characteristics and Traits (Punnett square; a monohybrid Yy × Yy cross gives 1 YY : 2 Yy : 1 yy and 3 yellow : 1 green; the test cross), https://openstax.org/books/biology-2e/pages/12-2-characteristics-and-traits, retrieved 2026-10-02; two true-breeding parents give all heterozygous offspring"
    },
    {
      "given": {
        "genes": "2",
        "p1a": "Aa",
        "p1b": "Bb",
        "p2a": "Aa",
        "p2b": "Bb"
      },
      "expect": {
        "phenotypes": "9 A_B_ : 3 A_bb : 3 aaB_ : 1 aabb",
        "genotypes": "1 AABB : 2 AABb : 1 AAbb : 2 AaBB : 4 AaBb : 2 Aabb : 1 aaBB : 2 aaBb : 1 aabb",
        "allDominant": 56.25,
        "firstOnly": 18.75,
        "secondOnly": 18.75,
        "allRecessive": 6.25,
        "gametes": "Parent 1: AB, Ab, aB, ab; parent 2: AB, Ab, aB, ab"
      },
      "source": "OpenStax, Biology 2e, section 12.3 Laws of Inheritance (a 4 × 4 Punnett square of a dihybrid cross gives 9 : 3 : 3 : 1), https://openstax.org/books/biology-2e/pages/12-3-laws-of-inheritance, retrieved 2026-10-02; hand calculation in content.mdx: 16 cells, 9 : 3 : 3 : 1"
    },
    {
      "given": {
        "genes": "2",
        "p1a": "Aa",
        "p1b": "bb",
        "p2a": "aa",
        "p2b": "Bb"
      },
      "expect": {
        "phenotypes": "1 A_B_ : 1 A_bb : 1 aaB_ : 1 aabb",
        "genotypes": "1 AaBb : 1 Aabb : 1 aaBb : 1 aabb"
      },
      "source": "hand calculation in content.mdx: each gene is a 1 : 1 test cross, so every phenotype is 1/4"
    }
  ],
  "sources": [
    "OpenStax, Biology 2e, section 12.2 Characteristics and Traits (Punnett square; 1 : 2 : 1 genotypes and 3 : 1 phenotypes in a monohybrid cross; the test cross), CC BY 4.0, retrieved 2026-10-02. https://openstax.org/books/biology-2e/pages/12-2-characteristics-and-traits",
    "OpenStax, Biology 2e, section 12.3 Laws of Inheritance (independent assortment; a 4 × 4 dihybrid Punnett square gives 9 : 3 : 3 : 1), CC BY 4.0, retrieved 2026-10-02. https://openstax.org/books/biology-2e/pages/12-3-laws-of-inheritance"
  ],
  "related": [
    "probability",
    "percentage",
    "ratio"
  ],
  "changelog": []
}
