Phylogenetic Tree 3D

Build an unrooted neighbor-joining tree from a distance matrix; explore labelled 2D and 3D views and export Newick.

About this tool

Build a neighbor-joining tree from 3–8 named taxa and a complete distance matrix. Primates and birds use invented illustrative distances, not measured evolutionary data. The exact four-taxon example has a known additive tree: A/B and C/D form the two pairs, terminal branches have length 1 and the internal branch length is 2.

Names and matrix rows/columns have the same order. Enter one unique name per line (up to 40 characters) and one matrix row per line. Separate columns with spaces or semicolons. Decimal points, decimal commas and scientific notation are accepted; commas do not separate columns. Distances must be finite, non-negative and at most 1,000,000. The matrix must be symmetric with an exactly zero diagonal. Editing either field switches to custom data and removes the old result; Build tree always uses the current fields.

Neighbor joining estimates an unrooted tree, without a molecular clock, evolutionary time or inferred ancestor. The three-way central join is only a drawing choice. Both labelled views show topology: on-screen lengths and spatial positions are not proportional to calculated branch lengths. Open Branch lengths to read all terminal and internal edges in the same units as the input matrix. RMSE compares all reconstructed pairwise path lengths with the supplied distances; zero within rounding means the distances fit this tree.

Non-additive distances can yield negative branch lengths. These are flagged, preserved in the details and exported without silently clamping them. They are a diagnostic of the distance estimate, not a biologically negative amount of evolution. Ties are resolved deterministically in input order; different ordering may select an equally scoring topology.

2D is available without WebGL. Select 3D to rotate a labelled view by dragging; Ctrl/Meta plus the wheel zooms, while the plain wheel scrolls the page. The view does not rotate automatically. Export Newick downloads the full tree, taxon names and calculated branch lengths with an unrooted marker. Names are quoted and apostrophes escaped. Reset clears the result while retaining input; saved links/reload retain only valid input, not a running renderer.

PHYLIP · Saitou & Nei (1987)

Very large custom inputs may exceed the saved-page-state limit; they remain usable in the current session, but may need re-entering after reload.