Cladogram Maker
Home/The Newick format, explained

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 viewer

What 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.

((A,B),(C,D));ABCD
The same four-taxon tree written in Newick. Each inner pair of brackets, shown in blue, is a clade.

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

SymbolMeans
( )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:

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.

Frequently asked questions

What is the Newick format?
A plain-text way of writing a phylogenetic tree using nested parentheses, ending in a semicolon. Sister taxa are grouped in brackets, branch lengths follow a colon, and internal labels (often support values) sit after a closing bracket.
How do I open or view a Newick file online?
Paste the Newick string into the Import Newick box on this site and the tree is drawn instantly. Branch lengths and bootstrap support are read automatically, and you can then export the figure as SVG or PNG.
What does the colon mean in Newick?
A colon introduces a branch length, the number after it's how much change (or time) that branch represents. For example, A:0.1 puts taxon A on a branch of length 0.1.
What is the number after a closing bracket?
It labels the internal node just closed. Numeric labels are read as support values (bootstrap percentages or posterior probabilities) for that clade; text labels are treated as a name for the ancestor.
Can I convert Newick to NEXUS?
Yes. Import the Newick tree, then export as NEXUS. You can also re-export Newick, and branch lengths and support values are preserved through the round-trip.