ACGT Gene Lab

How does DNA decide eye color?

Three real DNA letters, exact inheritance math and an iris that changes in front of you. Pick two people, see the chances for their child's eyes, then edit the DNA and watch what happens.

Two people

Choose their eye colors, or switch to DNA mode if you know their genotype.

Person A
Person B

Their child's eye color chances

Each iris shows a typical eye in that group. Percentages include the effect of other genes, so even the same DNA can give slightly different eyes.

The math, gene by gene

Every person has two copies of each DNA letter and passes one of them on, at random, 50/50.

How the numbers are calculated
  1. Start with the population. Before we know anything, each genotype has the frequency predicted by Hardy–Weinberg: p², 2pq, q², using allele frequencies from a Dutch study (Liu et al., 2010).
  2. Update with the eye color you picked (Bayes' rule). P(genotype | eye color) ∝ P(eye color | genotype) × P(genotype). This tells us how likely each hidden DNA combination is for that person.
  3. Pass the letters on (Mendel). A person with k “light” letters out of 2 passes a light letter with probability k/2. For a child: P(two light) = pA·pB, P(one) = pA(1−pB) + (1−pA)pB, P(none) = (1−pA)(1−pB).
  4. Turn DNA into eye color. Each genotype gets a melanin score. Other genes add random variation (normal distribution, σ = 9), and the chance of each color is the area of that curve inside the color's range.

DNA editor: what if one letter changed?

This is one possible child of the two people above (their most likely DNA). Click a letter to swap it, like a lab experiment, and see the iris respond.

What do these letters and chromosomes do?

Chromosomes and copies. DNA is packed into 23 pairs of chromosomes: one set from each parent. So every letter below comes in two copies, one from mum and one from dad. Each letter here is a single-letter difference between people (a SNP).

HERC2 on chromosome 15: the on/off switch. This letter is not in a pigment gene itself. It sits next to OCA2 and works like a light switch for it. A keeps the switch ON, so OCA2 is busy in the iris and makes melanin. G turns it OFF, so the iris makes very little melanin and looks blue.

OCA2 on chromosome 15: the pigment pump. OCA2 helps the pigment factories (melanosomes) make melanin. C gives the normal protein. T gives a weaker one, so less melanin is made. It matters most when the HERC2 switch is half on (A/G): that is one route to green and hazel.

SLC24A4 on chromosome 14: a small helper. It moves ions in pigment cells. T is linked to slightly lighter eyes and hair. One letter alone changes little, but small helpers add up.

Why one letter changes the color. These letters only change how much melanin the front of the iris gets. The color itself comes from physics: little melanin lets scattered blue light out, more melanin absorbs it and the eye turns green, hazel or brown. See it in the physics simulator.

Rare variants beat the switches. In albinism, both copies of the TYR gene don’t work, so no melanin can be made at all, whatever HERC2 and OCA2 say. Heterochromia happens when only some pigment cells carry a different instruction.

    Rare real variants

    Sci-fi lab: what if…?

    DNA from other species, or no species at all. Clearly labelled, so you always know what is real.

      Light brown

      60 / 100 melanin score

        Real life: nobody can change a person's eye color by editing DNA after birth, and editing the genes of human embryos is banned or strictly limited in most countries. This editor is a model to learn how the genes work.

        Eight real eye colors, and where they come from

        Every human eye uses the same two ingredients: brown-black melanin and a little yellowish pigment. Amount, position and light scattering do the rest.

        The physics: how an iris makes color

        White light goes in, some of it comes back out. The color is whatever comes back. Move the sliders and watch 36 wavelengths of light travel through a slice of iris.

        Light that comes back

          What just changed, and why

          Move a slider or pick a real eye, and this box explains what the light did.

          Cross-section of the iris
          Reflected spectrum: how much of each wavelength comes back

          The pupil

          The pupil has no color

          The pupil is a hole. Light goes in and gets absorbed inside the eye, so it looks black. The red eye in flash photos is light bouncing back off the blood-rich retina. Eye color is the iris, the ring around the hole.

          Absorption

          Melanin eats light

          Melanin absorbs every color, but more blue than red: in measurements on melanin granules, absorption grows about as λ−3.5, so blue (450 nm) is absorbed about 3.6× more than red (650 nm). What survives is warm. More melanin means brown, then almost black.

          Rayleigh scattering

          Blue is made by tiny fibers

          The stroma is a clear layer full of tiny collagen fibers, much smaller than a light wave. These scatter short wavelengths more, as 1/λ4: blue bounces back about 4.4× more than red. Red goes deeper and is swallowed by the black back layer. Same physics as a blue sky in front of black space.

          Mie scattering

          Grey: bigger particles?

          Scientists don't fully know yet. The leading idea: larger collagen deposits, about as big as a light wave, scatter all colors almost equally (Mie scattering). The exponent drops from 4 towards 0, so no color wins and blue turns grey or silver.

          Mixing

          Green and hazel are mixes

          Green is blue scattering plus a yellow pigment (lipochrome) that absorbs some of the blue, plus a little melanin. Hazel has more melanin near the pupil and less at the edge, so one eye shows two colors.

          Thickness

          Thick or thin stroma

          A thicker stroma has more fibers to scatter and more pigment along the light path, so the color is stronger. A thin one lets more light reach the black back layer, so the eye looks darker or duller. Thin spots called crypts show as dark dots.

          Pupil size

          Why eyes “change color”

          Eye doctors confirm that eye color can look different when the pupil widens. A common explanation: the same iris tissue is squeezed into a smaller ring, so pigment and fibers bunch up and the color gets stronger. Lighting, clothes and makeup change what reaches your eye too. The DNA stays the same.

          Blood

          Red vessels, hidden

          Hemoglobin absorbs violet (415 nm) and green-yellow (542, 577 nm) and lets red through. Normally melanin and the black back layer hide this. In albinism the back layer has no pigment, so red light from inside the eye shines through: violet, pink or red eyes.

          Two colors at once: heterochromia

          Some people have a ring of another color, a slice of another color, or two different eyes. It is the same physics as above: one part of the iris simply has more or less melanin than the rest. Pick two colors and see all three types.

          Most common

          Central: a ring

          Why: the zone around the pupil holds more (or less) melanin than the outer zone. The two zones are divided by the collarette, the wavy ring you can see in every iris, and they develop a little differently. Usually in both eyes, present from childhood and harmless. Often called hazel.

          Uncommon

          Sectoral: a slice or patch

          Why: in the embryo, pigment cells migrate into the iris and multiply. If one group of cells carries a small genetic difference (mosaicism), its descendants fill one area with more or less melanin. The patch is often shaped like a pie slice, but it can be any size. A small dark spot can also be an iris freckle (nevus).

          Rare

          Complete: two different eyes

          Why: the whole iris of one eye makes a different amount of melanin. Most cases are inborn and harmless. Some come from a syndrome or a nerve problem, and a few appear later in life (see the table below).

          How common is each type?
          • Centralmost common, often unnoticed
          • Sectoraluncommon
          • Completeabout 6 in 10,000

          Bars are a rough ranking, not exact numbers. Only complete heterochromia has a good count: a study of photos of over 11,000 people found clearly different eyes in about 0.06%.

          What can cause heterochromia
          CauseBorn with it or laterWhat happens to the color
          Benign genetic variation or mosaicismBornAny type. The most common reason, no disease behind it.
          Congenital Horner syndromeBornThe nerve signal that tells iris cells to make pigment is missing on one side, so that eye stays lighter and its pupil is smaller.
          Waardenburg syndrome, piebaldismBornPigment cells don’t reach the whole iris: one eye or a sector becomes pale blue. Waardenburg can also cause hearing loss.
          Sturge–Weber syndromeBornExtra blood vessels and pigment: the affected eye is often darker.
          Glaucoma eye drops (latanoprost and similar)LaterStimulate melanin production: a light eye slowly turns browner. Reported in up to a third of people using them for 5 years or more.
          Inflammation (e.g. Fuchs uveitis)LaterDamages the front layer of the iris: the eye becomes lighter.
          Injury, bleeding or iron splinter (siderosis)LaterBlood or iron deposits stain the iris darker, rusty brown.
          Iris freckle, nevus or tumorLaterA dark spot or patch that may grow.

          Heterochromia you were born with is usually harmless. If an eye changes color as a teen or adult, see an eye doctor: a new color change can be the first sign of inflammation, glaucoma-drop side effects or, rarely, a tumor.

          Eye clinic: what doctors can see in the iris and pupil

          Real conditions that change how the iris, pupil or cornea edge looks, from harmless rings to emergencies. Pick one to see a simplified drawing. The iris uses the color from the physics simulator above.

          Usually harmlessSee a doctorUrgent

          This is not a diagnosis. The drawings are simplified so you can recognise the signs. Only an eye exam can tell what is really going on. Sudden pain, a red eye with light sensitivity, blood in the eye or a white pupil in a child’s photo need a doctor quickly.

          Myth check

          Can the iris show problems in your liver or kidneys?

          No. Iridology claims that every organ has a zone in the iris, but controlled, blinded studies have found no diagnostic value. The real signs above are different: each one is caused by something happening in the eye itself, or by a disease that deposits something there (like copper in Wilson disease).

          Bonus: blood type

          Blood type is simpler: classic Mendelian genetics on two genes, ABO (chromosome 9) and RHD (chromosome 1).

            The science behind it

            HERC2 · rs12913832

            The main switch

            A single letter in the HERC2 gene controls how strongly the neighbouring OCA2 gene works in the iris. The G version turns it down, so less melanin is made. Two G copies usually mean blue eyes.

            OCA2 · rs1800407

            The fine tuner

            This letter changes the OCA2 protein itself. The T version is rare, but it lightens the eye, mostly in people who carry one A and one G at the main switch. That's one route to green and hazel.

            SLC24A4 · rs12896399

            A small helper

            A gene on chromosome 14 with a smaller effect. The T version is linked to lighter eyes and hair.

            Physics

            No blue pigment

            Eyes only contain brown-black melanin. With very little of it, light scatters in the iris like in the sky and the eye looks blue. More melanin gives green, hazel, then brown. Try the physics simulator.

            Honesty

            What's simplified

            The inheritance math is exact. The DNA-to-color step uses approximate effect sizes that follow published findings, and other genes are treated as random variation. Forensic labs use validated models such as IrisPlex.

            Blood

            A, B and O

            A and B are both dominant, O is recessive. Rh positive is dominant over Rh negative. For unknown hidden variants we use typical European allele frequencies. A blood test always beats a calculator.

            How this lab was built

            1. 1

              Reading the science

              Eye color research points to one DNA letter in HERC2 (rs12913832) as the main switch, with smaller helpers such as OCA2 rs1800407 and SLC24A4 rs12896399. Forensic tools like IrisPlex use six such letters.

            2. 2

              Turning DNA into numbers

              Each person has 0, 1 or 2 “light” letters per gene. That gives 3 × 3 × 3 = 27 possible genotypes. Each one gets a melanin score from 0 to 100, with effect sizes chosen to follow published findings (HERC2 strongest, OCA2 mostly with A/G, SLC24A4 small).

            3. 3

              Adding real-life randomness

              Dozens of other genes also nudge eye color. Instead of ignoring them, the model adds a bell curve (normal distribution, σ = 9) around each score. The chance of each color is the area of the curve inside that color's range.

            4. 4

              Guessing hidden DNA

              When you pick only an eye color, the lab uses Bayes' rule with population frequencies to estimate which genotypes that person probably has. Then Mendel's rule (each parent passes one of two copies, 50/50) gives the child's chances. All 27 × 27 combinations are calculated exactly, no shortcuts.

            5. 5

              Drawing the iris

              Every eye is painted live in a canvas: a color gradient chosen by the melanin score, about 800 random radial fibers, small dark “crypts”, the wavy collarette ring, a darker limbal ring and a reflection. Green and hazel eyes get a golden ring around the pupil, like real ones.

            6. 6

              Simulating light

              The physics simulator follows 36 wavelengths from 380 to 730 nm through three layers: melanin absorption (∝ λ−3.5), yellow pigment, collagen scattering (from Rayleigh 1/λ4 to Mie), hemoglobin bands and a black or see-through back layer. The reflected spectrum is turned into a screen color with the CIE 1931 color matching functions under daylight, then converted to sRGB.

            7. 7

              Keeping it honest

              The inheritance math is exact. The DNA-to-color step is a simplified teaching model, not a medical or forensic test. The physics uses real laws, but the layer strengths are tuned by hand for teaching. Sci-fi options are clearly labelled. Everything runs in your browser in plain JavaScript; nothing is sent anywhere.

            Sources

            The genetics and physics come from these studies and references. The layer strengths in the simulator and the effect sizes in the calculator are simplified by hand for teaching.

            Questions

            Which gene decides eye color the most?

            One DNA letter, rs12913832 inside the HERC2 gene on chromosome 15, has the biggest effect. It controls how strongly the neighbouring OCA2 gene works in the iris. People with two G letters usually have blue eyes; people with A letters usually have brown or intermediate eyes.

            Why are blue eyes blue if there is no blue pigment?

            Blue eyes have very little melanin in the front layer of the iris. Light scatters in that layer, much like the blue of the sky. More melanin gives green, hazel or brown.

            Can two blue-eyed people have a brown-eyed child?

            It is rare but possible, because many genes influence eye color. That is why this calculator shows probabilities and adds the effect of other genes as random variation, instead of giving one fixed answer.

            Are violet or red eyes real?

            Yes, in people with albinism. With almost no melanin, the iris becomes pale and see-through, and light reflected from blood vessels inside the eye can make it look violet or red. True purple pigment does not exist in human eyes.

            What are amber and grey eyes?

            Amber eyes are an even golden or copper color caused by more of a yellowish pigment (lipochrome). Grey eyes have very little melanin like blue eyes. Scientists think larger collagen deposits in the iris scatter all colors about equally, so they look grey.

            Why is the pupil black?

            The pupil is a hole into the eye. Light that goes in is absorbed inside the eye and almost none comes back, so it looks black. With a camera flash, light bounces off the blood-rich retina and returns straight to the lens, which causes red eye in photos.

            Why do eyes seem to change color?

            The DNA does not change, but the look does. When the pupil widens, the iris tissue bunches up and the color gets stronger. Different light sources, clothes and makeup change which colors reach your eye. Light eyes change the most, because their color depends on light scattering.

            Why do some people have two different eye colors?

            This is called heterochromia. One iris, or one part of an iris, has more or less melanin than the rest. It comes in three types: a ring around the pupil (central, the most common), a slice or patch (sectoral) and two different eyes (complete, rare). Most people are born with it and it is harmless, but an eye that changes color later in life should be checked by an eye doctor.

            Which diseases can be seen in the iris or pupil?

            Some real examples: a grey ring of fat at the cornea edge (arcus, sometimes linked to high cholesterol), a copper ring in Wilson disease (Kayser–Fleischer ring), small tan bumps in neurofibromatosis type 1 (Lisch nodules), new blood vessels in advanced diabetic eye disease (rubeosis), inflammation (uveitis), blood in the eye (hyphema) and a white pupil in flash photos (leukocoria). Iridology, the idea that the iris maps your organs, has not held up in controlled studies.

            How accurate is this calculator?

            The inheritance math is exact for the three DNA variants used. The step from DNA to eye color is a simplified teaching model with approximate effect sizes that follow published findings. Forensic labs use validated models such as IrisPlex with six variants.