Codominance cross ratio calculator
Two roan RW cattle produce calves in a 1:2:1 ratio, 25% red, 50% roan and 25% white, because a codominant heterozygote shows both alleles. Enter each parent's genotype to get phenotype and genotype ratios. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Parent1
- RW
- Parent2
- RW
- Phenotype aa
- red
- Phenotype bb
- white
- Phenotype ab
- roan
- Cross
- RW × RW
- Allele a
- R
- Inheritance
- codominance
- Square size
- 4
A codominance cross ratio calculator turns two parental genotypes at a single two-allele locus into the offspring phenotype and genotype ratios you would read from a Punnett square. Unlike complete dominance, where the heterozygote looks like the dominant homozygote, both alleles are fully expressed together: cattle that inherit red and white alleles are roan, and people who inherit M and N blood-group alleles type as MN. Enter the diploid genotype of each parent, optionally label the two homozygotes and the heterozygote, and the tool enumerates the four equally likely gamete pairings, groups identical genotypes, maps each class to its codominant phenotype, and returns reduced ratios, fractions, and percents.
What a codominance cross is and why the ratio is not 3:1
Codominance is a one-locus inheritance pattern in which the heterozygote expresses both alleles at once rather than masking one of them. The classic classroom pictures are shorthorn cattle, where RR is red, WW is white, and RW is roan with both red and white hairs visible, and the MN blood-group system, where MM, NN, and MN are three distinguishable types. Because the heterozygote is its own phenotype, a monohybrid Punnett square does not collapse into the 3:1 phenotypic ratio of complete dominance.
Two heterozygotes produce four equally likely zygotes—homozygote of the first allele, two heterozygotes, homozygote of the second allele—so both the genotype ratio and the phenotype ratio reduce to 1:2:1. A heterozygote crossed with a homozygote yields a 1:1 mix of heterozygotes and that homozygote. Two different homozygotes yield only heterozygotes.
Two identical homozygotes yield a single class. This calculator is restricted to one diploid locus with at most two distinct alleles: each parent contributes exactly two allele symbols, the four gamete pairings are enumerated, alleles inside a genotype are written in a stable lexicographic order so RW and WR count as the same class, and unused phenotype classes are omitted from the ratio instead of being padded with zeros.
Incomplete dominance, where the heterozygote is an intermediate blend such as pink flowers, is a different search intent and is not remapped here; the labels you supply are recorded as given so a roan herd record and an MN serology worksheet can share the same engine.
Where a codominance calculator helps
Biology classrooms and tutoring platforms use a codominance Punnett calculator so learners can check a 1:2:1 roan or MN worksheet without flipping which class is the heterozygote. Exam-prep generators need a deterministic oracle that rejects a three-allele paste instead of silently inventing a ratio a buggy grader might accept. Failed validation does not consume balance.
Keep genotypes to two alleles, pin the reduced ratio strings in tests, and you get reproducible 1:2:1, 1:1, and 1 results for homework, LMS plugins, and breeding worksheets without a computer-algebra stack. Related searches for incomplete dominance or a dihybrid 9:3:3:1 square are different intents: stay on this page when both alleles must remain visible in the heterozygote, and use a dedicated dominance or two-locus tool when they are not.
What you can do with it
Classroom Punnett checks for roan and MN
Students submit two parental genotypes and compare the reduced 1:2:1 or 1:1 phenotype ratio against a hand-drawn square before a lab write-up.
Livestock colour worksheets
Breeding notes for red, white, and roan cattle get a four-cell count without opening a pedigree application for a single coat locus.
FAQ
How do I calculate a codominance phenotype ratio from two parents?
Send diploid genotypes in parent1 and parent2 (for example RW and RW, or MN and NN).
How is this different from complete dominance?
Under complete dominance the heterozygote matches one homozygote and a monohybrid phenotypic ratio is 3:1. Under codominance the heterozygote is distinct, so two heterozygotes give 1:2:1 for both genotype and phenotype.
Which genotype formats are accepted?
Two-letter strings such as RW, MN, and AB, or two tokens with a slash, plus, or space such as R/W and IA/IB. Each parent must have exactly two alleles and the cross at most two distinct alleles.
Can I name the phenotypes red, white, and roan?
Defaults are the first allele, the second allele, and first+second for the heterozygote.
What do two homozygous parents of different types produce?
Only heterozygotes. Crossing a red RR animal with a white WW one, for example, gives all roan offspring, because every calf receives one allele of each kind and shows both.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/bio/codominance-cross-ratio \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"parent1":"RW","parent2":"RW"}'const res = await fetch("https://api.kit.forhosting.com/bio/codominance-cross-ratio", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"parent1": "RW",
"parent2": "RW"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/bio/codominance-cross-ratio",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"parent1": "RW",
"parent2": "RW"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/bio/codominance-cross-ratio", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"parent1":"RW","parent2":"RW"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"parent1":"RW","parent2":"RW"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/bio/codominance-cross-ratio", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"parent1": "RW",
"parent2": "RW"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "bio.codominance_cross_ratio",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Input contract, response shape, and error behaviour
Each value is a two-letter string such as RW, MN, or AB, or two allele tokens separated by a slash, plus sign, or whitespace such as R/W or IA/IB. Allele symbols start with a letter and may continue with letters or digits, so single-letter livestock alleles and two-letter blood-group alleles both parse. A string that is not exactly two alleles, an allele that fails the symbol pattern, a label longer than forty characters, or a cross that introduces a third distinct allele is likewise rejected. Those failures are not billed. POST a JSON body with two required diploid genotypes, parent1 and parent2 (aliases genotype1, p1, first_parent and genotype2, p2, second_parent). Optional phenotype_aa, phenotype_bb, and phenotype_ab replace the default labels: the lexicographically first allele for its homozygote, the second allele for its homozygote, and first-plus-second for the heterozygote. Missing, empty, or non-string genotypes fail with invalid_input naming the field. On success the body echoes the canonical parent genotypes and a cross string, names allele_a and, when present, allele_b, sets inheritance to codominance, reports square_size and offspring_total of four, and publishes phenotype_ratio and genotype_ratio as reduced colon-separated counts. phenotypes and genotypes are arrays of records with genotype, phenotype, count, total, fraction, and percent; punnett lists the four cells with the contributing gametes. Example: parent1 RW, parent2 RW, phenotype_aa red, phenotype_bb white, phenotype_ab roan yields phenotype_ratio 1:2:1 and percents 25, 50, 25. Pair the records with your own drawing code if you need a printed square; this endpoint solves the counts only.
Where a codominance ratio API earns its keep
Livestock records for shorthorn or Belgian Blue colour and teaching blood-bank modules for the MN system both reduce to the same two-allele square; calling a tiny parse API avoids standing up a full pedigree engine for a single locus.
Integration use cases
Exam oracles and coding kata fixtures
Graders and student genetics solvers pin expected phenotype ratios and invalid_input cases for three-allele or malformed genotype strings.
Technical questions
What does the codominance cross ratio calculator cost?
The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.