Cladogram Maker
Home/Newick vs NEXUS

Newick vs NEXUS

Newick and NEXUS are the two text formats you meet most often when moving phylogenetic trees between programs. The short version: Newick is one tree on one line, and NEXUS is a container that holds that same tree plus the data and settings around it.

The one-line summary

A Newick file is a tree, written as nested parentheses ending in a semicolon. A NEXUS file is a document that contains a tree (in a TREES block) alongside other blocks for the taxa and data. Crucially, the tree inside a NEXUS file is written in Newick, so the two are not rivals so much as one nested inside the other.

tree.nwk((A,B),C);tree.nex#NEXUSBEGIN TREES;  ((A,B),C);END;ABC
The same tree, two containers. The one-line Newick file and the multi-block NEXUS file describe an identical tree; the NEXUS version simply carries it inside a labelled block, in blue.

What each one stores

NewickNEXUS
Basic unitOne tree, one lineA document of labelled blocks
Multiple trees in one fileOne per lineYes, all in the TREES block
Taxon list and data matrixNoYes (TAXA, DATA / CHARACTERS blocks)
Analysis settingsNoYes (in dedicated blocks)
Branch lengths and supportYesYes (same Newick syntax, inside TREES)
Typical extension.nwk, .newick, .tree.nex, .nexus
Best forMoving a tree quicklyCarrying trees plus data and settings

When to use Newick

Use Newick when the tree is the only thing you need to move. It is compact, almost every program reads it, and you can paste it straight into a viewer. If someone asks for "the tree" and nothing else, send Newick. The Newick format guide walks through the syntax.

When to use NEXUS

Use NEXUS when the tree needs to travel with its data or its analysis settings, when you want several trees and their shared taxon list in one tidy file, or simply when the program you are feeding requires it. MrBayes, PAUP* and Mesquite all expect NEXUS. The NEXUS format guide breaks down the blocks.

Converting between them

Because a NEXUS tree is Newick inside, converting is mostly wrapping or unwrapping:

Doing it in this tool

This tool imports Newick and exports both Newick and NEXUS. So it doubles as a converter:

Build yours in the browser, no signup, no install.

Open the cladogram maker

Frequently asked questions

What is the difference between Newick and NEXUS?
Newick is a single tree written as nested parentheses on one line. NEXUS is a container document that can hold that same tree in a TREES block along with the taxon list, a data matrix and analysis settings. A NEXUS tree is written in Newick, so NEXUS is Newick with a structured wrapper.
Which is better, Newick or NEXUS?
Neither is better in general; they suit different jobs. Newick is best for moving a single tree quickly. NEXUS is best when the tree must travel with its data and settings, or when the target program requires it, such as MrBayes or PAUP*.
Can I convert NEXUS to Newick?
Yes. Find the TREES block and copy the parenthesised string ending in a semicolon; that is the Newick tree. If the file has a TRANSLATE table, replace the numbers in the tree with the taxon names it lists first.
Does NEXUS keep branch lengths and support values?
Yes. The tree inside a NEXUS TREES block uses the same Newick syntax, so branch lengths (after a colon) and support values (after a closing bracket) are preserved just as they are in a Newick file.
How do I convert Newick to NEXUS online?
Paste your Newick string into Import Newick on this site, then choose Export NEXUS. The tool wraps the tree in a proper NEXUS file with a taxon block, ready for MrBayes, PAUP* or Mesquite.