Phylogenetic Distance Calculator

Calculate Jukes-Cantor, Kimura 2-parameter, and other evolutionary distances.

0-1
For K2P model
For K2P model
Please check your inputs and try again.

Why Observed Differences Understate Divergence

Counting differing sites underestimates the substitutions that actually occurred, because a site can change more than once. A second change may revert the site or produce a different base, but either way only one difference is counted.

JC: d = −¾ ln(1 − ⅔p)     K2P: d = −½ ln(1−2P−Q) − ¼ ln(1−2Q)
Observed pJC distance dUnderestimate
0.050.0524%
0.150.16711%
0.250.30422%
0.500.82465%
0.75undefinedSaturation limit

At p = 0.75 the sequences are statistically indistinguishable from random, since four bases chosen at random match a quarter of the time. The correction becomes unreliable well before that, typically above p ≈ 0.5.

Why K2P Usually Fits Better

Jukes–Cantor assumes all substitution types are equally likely. In reality transitions outnumber transversions roughly two to one, because purine-to-purine and pyrimidine-to-pyrimidine changes are chemically easier and often synonymous in the third codon position.

ModelAssumesParameters
Jukes–CantorAll substitutions equal, equal base frequencies1
Kimura 2-parameterTransitions ≠ transversions2
HKY85Plus unequal base frequencies5
GTRAll six substitution types differ9

More parameters fit better but need more data to estimate reliably. Model selection tools such as jModelTest use information criteria to balance fit against overparameterisation, rather than simply choosing the most complex option.

Rate Heterogeneity Across Sites

All these models assume every site evolves at the same rate, which is badly false. Third codon positions change freely while first and second are constrained, and structural or catalytic residues barely change at all.

Adding a gamma distribution of rates across sites usually improves fit more than any additional substitution parameter, which is why models are commonly written as GTR+Γ rather than GTR alone.

Worked Examples

Example 1: p=0.15 proportion different sites
JC: d=-0.75×ln(1-0.2)=-0.75×(-0.223)
Result: d=0.167 (JC > p-distance, multiple hits)
Correction becomes important as p increases
Example 2: K2P: Ts=0.10, Tv=0.05
d=-0.5×ln(1-0.25)-0.25×ln(1-0.10)
Result: More accurate with realistic Ts/Tv ratio
Ts/Tv ≈ 2:1 in most datasets
Example 3: Why saturation limits the method
Sequences with p approaching 0.75
Result: Correction undefined
Four random bases match a quarter of the time, so p = 0.75 is the expectation for unrelated sequences. Distances become unreliable well before that.
Example 4: Why GTR+Γ is the common default
Rate variation across codon positions
Result: Gamma improves fit substantially
Third positions change freely while second positions barely change. Modelling that heterogeneity matters more than refining substitution types.

Common Mistakes

⚠️
Using uncorrected p-distance

Multiple substitutions at one site are invisible. The underestimate is 22% at p = 0.25 and 65% at p = 0.50.

⚠️
Applying JC when transition bias is known

Transitions typically outnumber transversions twofold. K2P separates them and generally fits real sequence data better.

⚠️
Choosing the most complex model available

More parameters need more data. Model selection should balance fit against overparameterisation using information criteria.

⚠️
Ignoring rate variation across sites

Third codon positions evolve far faster than first and second. Adding a gamma distribution usually improves fit more than extra substitution parameters.

Frequently Asked Questions

Why correct p-distance?
Multiple substitutions at same site: site can change A→G→A, appearing unchanged. This causes underestimation. JC correction assumes all changes equally likely. K2P allows transitions (purine↔purine, pyrimidine↔pyrimidine) to be more frequent than transversions.
Model selection?
Use ModelTest/jModelTest to find best-fit model from AIC/BIC. Common models: JC, K2P, HKY85, GTR. More parameters = better fit but more variance. GTR (general time reversible) is most general. Complex models preferred for phylogenomics.
Why correct the p-distance?
Because multiple substitutions at the same site are counted once. Observed differences understate true divergence, severely for distant sequences.
What is the difference between JC and K2P?
Jukes–Cantor treats all substitutions as equally likely; Kimura's model separates transitions from transversions, which occur at different rates.
Why not always use the most complex model?
Each parameter must be estimated from data. Overparameterised models fit noise, so selection criteria balance fit against complexity.
What does the +Γ mean in a model name?
A gamma distribution of substitution rates across sites, accounting for the fact that some positions evolve much faster than others.