Based on the phenotypes of the parents and grandparents, here are the probabilities for the baby:
Brown Eyes0%
Green Eyes0%
Blue Eyes0%
How Genetics Determine Baby Eye Color
Predicting a baby's eye color is a fascinating mix of biology and probability. While we often learn in school that brown eyes are dominant and blue eyes are recessive, the reality is slightly more complex. Human eye color is a polygenic trait, meaning it is determined by multiple genes. The two major genes responsible are OCA2 and HERC2 located on chromosome 15.
The Role of Grandparents in Prediction
This calculator is distinct because it factors in the grandparents. Why does this matter? Because parents can be "carriers" of recessive genes without showing them.
For example, if a father has Brown eyes, his genotype could be:
BB (Two brown alleles) – He will likely pass Brown to all children.
Bb (One brown, one blue allele) – He has a 50% chance of passing a Blue gene.
We cannot look at the father's eyes and know if he is BB or Bb. However, if the father's father (the grandfather) had Blue eyes, we know for a fact that the father inherited a Blue gene, making him a Bb carrier. This dramatically changes the probability of the baby having blue eyes.
Understanding the Colors
The Hierarchy of Dominance:
1. Brown is dominant over both Green and Blue.
2. Green is dominant over Blue but recessive to Brown.
3. Blue is recessive to both.
Why Blue Eyes Can "Skip" a Generation
Because Blue is recessive, a child must inherit a Blue gene from both parents to have Blue eyes. If two Brown-eyed parents both carry the hidden Blue gene (Bb), there is a 25% chance their child will have Blue eyes. This is why you often see eye colors seemingly reappear from grandparents to grandchildren, skipping the middle generation.
Limitations of this Model
This calculator uses the standard Two-Gene Model. While highly accurate for most families, rare genetic mutations, albinism, or heterochromia (different colored eyes) operate outside these standard rules. Additionally, eye color can permanently darken during the first 3 years of life, so a baby born with blue eyes may eventually develop green or brown eyes.
function calculateBabyEyeColor() {
// Get Inputs
var dadColor = document.getElementById('dadEye').value;
var dadGrandpa = document.getElementById('dadPaternalGrandpa').value;
var dadGrandma = document.getElementById('dadPaternalGrandma').value;
var momColor = document.getElementById('momEye').value;
var momGrandpa = document.getElementById('momMaternalGrandpa').value;
var momGrandma = document.getElementById('momMaternalGrandma').value;
// Determine Genotype Probabilities for Dad and Mom
// We will represent genotypes as an array of possible allele pairs [Allele1, Allele2]
// B = Brown, G = Green, b = Blue
// However, since we deal with probabilities, we will calculate the probability of passing B, G, or b.
var dadGenes = getGameteProbabilities(dadColor, dadGrandpa, dadGrandma);
var momGenes = getGameteProbabilities(momColor, momGrandpa, momGrandma);
// Calculate Baby Probabilities using a Punnett Square approach
// Baby Prob = (DadProb * MomProb) for every combination
var probBrown = 0;
var probGreen = 0;
var probBlue = 0;
// Iterate through Dad's possible contributions (B, G, b)
// keys: 'B', 'G', 'b'
var alleles = ['B', 'G', 'b'];
for (var i = 0; i 0) {
for (var j = 0; j 0) {
var comboChance = dadChance * momChance;
var phenotype = determinePhenotype(dadAllele, momAllele);
if (phenotype === 'brown') probBrown += comboChance;
if (phenotype === 'green') probGreen += comboChance;
if (phenotype === 'blue') probBlue += comboChance;
}
}
}
}
// Update UI
displayResults(probBrown, probGreen, probBlue);
}
// Helper to determine phenotype of child based on two alleles
function determinePhenotype(a1, a2) {
// Brown (B) is dominant over G and b
if (a1 === 'B' || a2 === 'B') return 'brown';
// Green (G) is dominant over b
if (a1 === 'G' || a2 === 'G') return 'green';
// Blue (b) is recessive
return 'blue';
}
// Helper to estimate the probability of a parent passing a specific gene (gamete)
// Returns object { B: 0.0, G: 0.0, b: 0.0 }
function getGameteProbabilities(personColor, gp1Color, gp2Color) {
// If Person is BLUE
// Must be 'bb'. passes 'b' 100%
if (personColor === 'blue') {
return { B: 0, G: 0, b: 1 };
}
// If Person is GREEN
// Could be 'GG' or 'Gb'.
// If either GP is Blue, Person is definitely 'Gb'.
// If neither GP is Blue, but one is Green, Person is likely 'Gb' or 'GG'.
if (personColor === 'green') {
if (gp1Color === 'blue' || gp2Color === 'blue') {
// Definitely Gb
return { B: 0, G: 0.5, b: 0.5 };
} else {
// Both GPs are Green or Brown.
// In general population, Gb is more common than GG, but let's assume a split.
// However, if parents were both Green (and not blue), chance of GG is higher.
// Simplified weighted average:
// Assume 60% Gb, 40% GG for calculation sake in ambiguous cases
// Resulting gametes:
// from GG: 100% G. From Gb: 50% G, 50% b.
// Combined: 0.4(1) + 0.6(0.5) = 0.7 G. 0.6(0.5) = 0.3 b.
return { B: 0, G: 0.75, b: 0.25 }; // Leaning slightly towards G dominance
}
}
// If Person is BROWN
// Could be BB, BG, or Bb.
if (personColor === 'brown') {
// Case 1: A grandparent is Blue.
// Person MUST carry Blue. Genotype Bb.
if (gp1Color === 'blue' || gp2Color === 'blue') {
return { B: 0.5, G: 0, b: 0.5 };
}
// Case 2: A grandparent is Green (and neither is Blue).
// Person likely carries Green. Genotype BG.
if (gp1Color === 'green' || gp2Color === 'green') {
// It is possible they are Bb if the Green GP was Gb, but BG is the direct inheritance assumption.
// Let's assume BG for the calculation to show Green influence.
return { B: 0.5, G: 0.5, b: 0 };
}
// Case 3: Both GPs are Brown.
// Genotype could be BB, Bb, or BG.
// Without recessive evidence, BB is most likely, but carriers are common.
// Let's assume a standard distribution for Brown-eyed parents with Brown-eyed parents:
// 60% BB, 20% Bb, 20% BG.
// Gametes from BB: 100% B
// Gametes from Bb: 50% B, 50% b
// Gametes from BG: 50% B, 50% G
// Total B: 0.6(1) + 0.2(0.5) + 0.2(0.5) = 0.6 + 0.1 + 0.1 = 0.8
// Total b: 0.2(0.5) = 0.1
// Total G: 0.2(0.5) = 0.1
return { B: 0.8, G: 0.1, b: 0.1 };
}
return { B: 0, G: 0, b: 1 }; // Fallback
}
function displayResults(pBrown, pGreen, pBlue) {
var resultArea = document.getElementById('result-area');
resultArea.style.display = 'block';
// Convert to percentage strings
var pctBrown = Math.round(pBrown * 100) + '%';
var pctGreen = Math.round(pGreen * 100) + '%';
var pctBlue = Math.round(pBlue * 100) + '%';
// Update Text
document.getElementById('probBrown').innerText = pctBrown;
document.getElementById('probGreen').innerText = pctGreen;
document.getElementById('probBlue').innerText = pctBlue;
// Update Widths
document.getElementById('barBrown').style.width = pctBrown;
document.getElementById('barGreen').style.width = pctGreen;
document.getElementById('barBlue').style.width = pctBlue;
// Scroll to results
resultArea.scrollIntoView({ behavior: 'smooth' });
}