HomeGenetics & EvolutionEvolutionary Genetics: Hardy-Weinberg, Selection and Genetic Drift

Evolutionary Genetics Simulator

Interactive population genetics simulator: watch allele frequencies shift generation by generation under Hardy-Weinberg equilibrium, natural selection and genetic drift. Change the environment, tune selection coefficient and population size, and compare drift in small vs large populations side by side.

Genetics & Evolution3DModerate60 FPS
evolutionary-genetics ↗ Open standalone

This simulator visualizes population genetics directly: two populations of organisms — one large, one small — carry two allele variants of the same gene at real Hardy-Weinberg proportions. Toggle which allele the simulated predator favors, tune the selection coefficient, and watch each generation reproduce under selection while the small population additionally drifts due to random sampling. The live chart tracks allele frequency across generations in both populations side by side, making the difference between deterministic selection and stochastic drift directly visible.

⚙ Under the hood

Two InstancedMesh populations of organisms carry two allele variants at Hardy-Weinberg proportions; toggle which allele the environment favors, tune the selection coefficient s, and watch p' = p(1+s)/(1+sp) shift allele frequency generation by generation, with a small population showing stronger genetic drift than a large one.

population geneticsHardy-Weinberg equilibriumnatural selectiongenetic driftallele frequencyevolutionThree.js

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)