What is a .nwk file?
text/x-nh
Newick is a compact parenthetical notation for trees, used across phylogenetics. Nested parentheses describe the topology, commas separate siblings, names label leaves and optionally internal nodes, a colon introduces a branch length, and a semicolon terminates the tree. Internal-node labels are frequently repurposed to carry bootstrap support values, which is why a parser must not assume a label is a taxon name.
How to use a .nwk file
Use an example .nwk file to test tree parsers and phylogeny viewers, checking quoted labels containing punctuation, missing branch lengths, unrooted versus rooted forms, and that deeply nested trees do not overflow a recursive reader.
Download example .nwk files
- Newick Tree — Branch Lengths and Support Values (.nwk)A six-taxon Newick tree with branch lengths on every edge and bootstrap-style support values written as internal node labels. That support notation is ambiguous by design in Newick — the same position can hold a node name — which is precisely what a parser has to decide about.
- Newick Tree — Topology Only, No Branch Lengths (.nwk)The identical tree topology with every branch length and support value stripped, which is what a Newick writer produces when the source tree has no lengths. Comparing the two proves a parser distinguishes 'length zero' from 'no length recorded'.