The Newick format, explained
Newick is the text format nearly every phylogenetics program uses to store a tree. It looks cryptic at first, but it's just nested parentheses. Once you can read it, you can hand-write a tree or fix one in a text editor. You can also paste any Newick string into the tool here to see it drawn.
Have a Newick string or .nwk / .tree file? Paste it to view the tree instantly.
Open the Newick viewerWhat Newick is
The Newick format (named after Newick's restaurant, where the spec was agreed in 1986) writes a tree as a string of nested parentheses ending in a semicolon. Sister taxa are grouped in brackets, and that nesting is the tree. Files usually end in .nwk, .newick or .tree.
Reading the parentheses
Start with the simplest possible tree, two taxa:
(A,B);A and B are sisters. Group two such pairs and you get a four-taxon tree, where the inner brackets are the smaller (more recent) clades:
((A,B),(C,D));Read it inside-out: A and B form a clade, C and D form a clade, and those two clades join at the root. Every opening bracket is a common ancestor; the taxa inside it are its descendants.
Branch lengths
A colon after a name gives that branch's length, the amount of change, or time, along it:
((A:0.1,B:0.2):0.05,(C:0.3,D:0.15):0.08);Here A sits on a branch of length 0.1, and the clade (A,B) sits on a branch of length 0.05 leading back toward the root. A tree with branch lengths is a phylogram; without them it's a cladogram. This tool reads the lengths and can draw the tree to scale.
Internal labels and support values
A name right after a closing bracket labels that internal node. Most often it's a support value, a bootstrap percentage or posterior probability for the clade:
((A:0.1,B:0.2)95:0.05,(C:0.3,D:0.15)100:0.08);The 95 and 100 are support for the (A,B) and (C,D) clades. This is the convention used by RAxML, IQ-TREE, MrBayes, MEGA and FigTree. A named internal node (like Mammalia) is written the same way; a numeric one is read as support.
The whole syntax in one place
| Symbol | Means |
|---|---|
( ) | A clade, everything inside shares a common ancestor |
, | Separates sister branches |
: | Introduces a branch length |
name after ) | Internal-node label, usually a support value |
; | Ends the tree (required) |
'…' | Quotes a name containing spaces or punctuation |
Viewing and converting a Newick file
To see a Newick string as an actual tree, open the tool and choose File → Import Newick, or use Import Newick on the home screen, then paste the text. Branch lengths and support values are both read. From there you can:
- Switch to phylogram mode to draw branches to scale
- Re-root, ladderize, collapse clades, and recolour
- Export a vector SVG or a high-resolution PNG figure
- Convert to NEXUS, or export Newick again, lengths and support are preserved, so it round-trips losslessly
Newick and NEXUS
NEXUS is a richer format that wraps one or more Newick trees together with data blocks and metadata; it's what programs like MrBayes and PAUP* use. If a tool asks for NEXUS, you can export it here. For simply moving a tree between programs, Newick is the common currency. See the NEXUS format explained for its block structure, or Newick vs NEXUS for a side-by-side comparison.