Converter tool

Phylogenetic Tree Viewer for Newick and Nexus

Open a Newick, NHX or Nexus tree, switch between rectangular, circular and unrooted layouts, reroot, collapse and colour clades, and export SVG, PNG or PDF.

Newick, NHX or Nexus

1. Your tree

Or paste the tree

Newick and Nexus Phylogenetic Tree Viewer

Operator: Abdulla Al Fahad. How tools are built and checked

A Newick string is a complete description of a tree and nearly unreadable as text: the nesting of parentheses carries the topology, the numbers after colons carry branch lengths, and a number after a closing parenthesis is a bootstrap or posterior probability. This page turns it into a drawing you can reroot, prune visually and hand to a journal. It reads Newick, NHX (the [&&NHX:...] annotations written by tools such as Notung and the ETE Toolkit) and Nexus files with a trees block, including the translate table that BEAST and MrBayes use to replace taxon names with numbers. Files up to 8 MB, 200 trees and 60,000 nodes are accepted, and the drawing covers up to 6,000 visible tips.

Key features

  • Rectangular, circular and unrooted (equal-angle) layouts, switchable on the same tree
  • Branch lengths drawn to scale with a scale bar, or a cladogram with all tips aligned
  • Internal labels read as support values (a single number, or a pair such as 92.5/100), shown above a threshold you set
  • Reroot on the branch above any node or tip, or midpoint root along the longest tip-to-tip path
  • Collapse a clade to a labelled triangle, colour a clade, ladderise, and search tip names
  • Export the drawing as SVG, PNG or vector PDF, the edited tree as Newick, and a tip list with root-to-tip distances as CSV

How Newick, NHX and Nexus trees are read, and what the layouts draw

A Newick tree ends at the first semicolon. Names may be quoted with single quotes (a doubled quote stands for one apostrophe), and anything in square brackets is a comment. [&R] and [&U] mark a rooted or unrooted tree; [&&NHX:S=Human:B=95] and BEAST-style [&height=0.3,posterior=0.99] annotations are kept on the node and listed when you select it. An NHX B= field is used as the support value when the node has no numeric label.

An internal label that is a number becomes support. A label such as 92.5/100, the SH-aLRT and ultrafast bootstrap pair from IQ-TREE, is shown as written and sorted by its first number. Any other internal label is a clade name. Underscores in names are kept as they are, so Homo_sapiens stays Homo_sapiens. A Nexus file is recognised by #NEXUS. The page reads the trees block, applies the translate table to the tips, and offers every tree command as a choice. A root with three children is reported as unrooted with no polytomy, and a root with more children than that, or an inner node with more than two, is counted as a polytomy.

How it works

The parser scans the text with an explicit stack rather than recursion, so a caterpillar tree 20,000 nodes deep opens without a stack overflow. Branch lengths must be plain numbers no larger than 1e100 in size; a stray character after a colon, or an unmatched closing bracket, stops the parse with the position instead of drawing a wrong tree. A negative length is accepted and flagged, since some methods write them: the drawing treats it as 0 while the totals, the root-to-tip distances and the tip list add it as written.

The rectangular layout puts tips on evenly spaced rows and each internal node halfway between its first and last child. The circular layout uses the same ordering as angles around a centre. The unrooted layout is the equal-angle method described by Felsenstein in Inferring Phylogenies: each subtree is given a wedge as wide as its share of the tips, and a branch points to the middle of its wedge.

Rerooting places a new root in the middle of the chosen branch and turns every branch on the path to the old root round, so tip-to-tip distances do not change. A binary old root is dissolved into one branch. Midpoint rooting finds the two most distant tips and puts the root halfway between them.

When this helps

  • A student has an IQ-TREE .treefile with 48 taxa and labels such as 87.3/95; they hide support below 70, root on the outgroup tip and export a PDF for a thesis figure.
  • A lab member opens a MrBayes .con.tre file whose tips are numbers 1 to 31, and the translate table turns them back into species names on load.
  • A reviewer asks for the tree with the five Pseudomonas isolates collapsed into one triangle and the others coloured by host; the page does both without redrawing by hand.
  • A bioinformatician with a 3,000-tip tree uses the search box to find every tip containing 'sp.' and exports a CSV of root-to-tip distances to spot outliers.

Opening a file

  1. Drop a tree file, paste the text, or load the 12-tip example.
  2. If the file holds several trees, choose one under Tree in file.
  3. Pick a layout, and switch branch lengths off if you want a cladogram.
  4. Press Midpoint root, or select a tip or node on the drawing and press Reroot on this branch.
  5. Collapse or colour clades, then download SVG, PNG or PDF under the drawing, or the edited Newick below it.

Example

An illustrative 12-tip tree, layout Rectangular, then Midpoint root

((Human:0.09,Chimp:0.10)100:0.05,((Mouse:0.35,Rat:0.30)100:0.12,Rabbit:0.40)87:0.08,(((Dog:0.20,Cat:0.18)100:0.07,(Cow:0.15,Pig:0.17)98:0.09)92:0.06,Horse:0.25)81:0.05,(Opossum:0.50,Platypus:0.70)100:0.30);

Tree summary and edited Newick

12 tips, 9 internal nodes, unrooted with one polytomy at the root, total branch length 4.21, longest root-to-tip 1.0 (Platypus)
After Midpoint root the root splits the 0.30 branch of the Opossum-Platypus clade into 0.075 on its side and 0.225 on the other, and Newick reads (((Human:0.09,Chimp:0.1)100:0.05,...)100:0.225,(Opossum:0.5,Platypus:0.7):0.075);

Tips for best results

  • Midpoint rooting assumes a clock-like tree; with very uneven rates, root on a known outgroup tip with Reroot on this branch instead.
  • Ladderise before exporting a figure of a balanced-looking tree. It changes only the order in which children are drawn, never the topology.
  • Past about 700 tips the circular and unrooted layouts stop printing labels; collapse clades or search for the tips you need.

Limits

Support values belong to branches, but Newick stores them on the node below. After rerooting, the branch that held the old root keeps one value; read the edited tree's support with that in mind.

Colours and collapsed clades are view settings. The Newick download does not contain them, and rerooting clears them because the nodes are renumbered.

A tree without branch lengths can only be drawn as a cladogram, and midpoint rooting is refused for it.

Common errors and how to fix them

The tree ends before every parenthesis is closed.
The text was cut off or a bracket is missing. Check the end of the file and make sure the tree finishes with a semicolon.
Expected a branch length after ":".
A colon is followed by something that is not a number, often a name with a colon in it. Quote such names with single quotes.
Unexpected "]" near position 6: a closing bracket with no matching "[".
A comment or annotation lost its opening bracket, or a stray ] was pasted in. Look near the reported position for a [&R], [&&NHX...] or BEAST annotation that was cut in half.
The branch length "1e300" is larger than 1e+100, which is the most this page handles.
Lengths that large are almost always a unit or export error. Rescale the lengths in the program that wrote the tree, or edit the value, and load it again.
The tree has more than 60,000 nodes.
Prune the tree in your phylogenetics software to the clade you need, or save a smaller subtree, and load that.

Best practices

  • Root before you collapse or colour, because rerooting resets both.
  • Keep the original file; the downloaded Newick is the current rooting and order, and the original is the only copy of how the program wrote it.
  • Say in a figure legend how the tree was rooted (outgroup or midpoint) and what the support values are.

Frequently asked questions

Can it open a tree with several trees, such as a bootstrap replicate file?

Yes, up to 200 trees from one file, chosen in a list. Only one is drawn at a time, and there is no consensus or tree comparison.

Why are some tip labels missing on a large tree?

Rectangular rows shrink below 9 pixels past about 1,200 tips, and circular and unrooted layouts print labels only up to 700 tips. Searching a name highlights and labels the matches at any size.

Can a Newick tree be unrooted if the text always has a top node?

Yes, by convention. Every Newick string nests inside one outermost pair of parentheses, so something always sits at the top, but an unrooted tree is written with a three-way split there: the top node is just the place the writer started, not an ancestor. A rooted tree has two children at the top. The page reports a top node with three children as unrooted, one with two as rooted, and lets a [&R] or [&U] comment override the guess. The equal-angle layout ignores the root position, so the two kinds with the same topology look alike, apart from the branch lengths that meet at the top; Midpoint root or Reroot on this branch turns an unrooted tree into a rooted one.

Does it estimate trees or support values?

No. It only draws and edits trees that another program has built; it does not align sequences or run bootstrap analyses.