Dendrogram Generator
Paste a data table or a distance matrix and get a hierarchical clustering dendrogram. Choose the distance and linkage, cut it into clusters, and download SVG, PNG or Newick for free.
Short answer: paste a data or distance matrix, choose a distance and a linkage method, and this page clusters it and draws the dendrogram. Download SVG, PNG or Newick for free.
Specs and limits
| Input | A data matrix (names in the first column, numbers after) or a square distance matrix, pasted as CSV or tab-separated text. Up to 200 items. |
|---|---|
| Distances | Euclidean, Manhattan or 1 − Pearson correlation, with optional z-scoring of the table columns. |
| Linkage | Single, complete, average (UPGMA) and Ward. Ward is offered only for a data matrix with Euclidean distance. |
| Output | SVG, PNG at 2x, a Newick text file and a CSV of cluster membership in leaf order. |
| Price and privacy | Free, no account. Calculated and drawn in your browser and nothing you enter is uploaded. |
| Does not do | Heat maps, bootstrap support values, or phylogenetic inference from sequences. |
First column: names. Other columns: numbers. A header row is optional. Comma or tab separated, with a point as the decimal mark. Up to 200 items. The values shown are made-up example data.
3 clusters at this cut.
Calculated and drawn in your browser. Nothing you enter is uploaded.
This page draws cluster trees. To view samples as points, use the PCA plot generator; to color-map the values, the heatmap generator. For an illustrated evolutionary tree, which is a different thing from clustering, try the phylogenetic tree maker.
Dendrogram Examples
Each tree is drawn by the same code as the tool above, from made-up example data. Free to view and download.
Gene Expression Sample Dendrogram
Euclidean distance and average linkage on example data. Replicates of each group join first.
What is a dendrogram?
A dendrogram is a tree diagram of a hierarchical clustering. Each leaf is one item, such as a sample, gene or species. Agglomerative clustering starts with every item on its own and repeatedly joins the two closest clusters until one remains. Each join is drawn as a bracket, and the position of that bracket on the distance axis is the distance between the two clusters when they were joined.
When to use a dendrogram
- To see whether replicates or samples from the same condition group together before a downstream analysis.
- To group genes or metabolites that behave alike across samples.
- To compare ecological communities by the taxa they contain.
- To summarise a distance matrix you computed elsewhere, as long as it is symmetric with a zero diagonal.
How to read a dendrogram
- Merge height is what carries information. The lower two items or branches join, the more alike they are under the distance and linkage you chose.
- To compare two leaves, follow them up to the first bracket that contains both and read its height.
- Left-to-right (or top-to-bottom) order is partly arbitrary. The two sides of any bracket can be swapped without changing the clustering, so two neighbouring leaves are not necessarily more similar than two leaves farther apart.
- A long vertical stretch before the next join suggests a well separated cluster. It is a visual cue, not a statistical test.
- Cutting the tree at a height, or into k clusters, gives group labels. The dendrogram does not tell you which k is correct.
Single, complete, average and Ward linkage
- Linkage defines the distance between two clusters.
- Single linkage uses the closest pair of members. It can follow elongated shapes, but it tends to chain items one at a time into a long straggling cluster.
- Complete linkage uses the farthest pair of members. It favours compact clusters and is sensitive to outliers.
- Average linkage (UPGMA) uses the mean of all pairwise distances between the two clusters. It is a common middle ground.
- Ward linkage joins the pair that increases the within-cluster sum of squares the least. It tends to give compact clusters and needs Euclidean distance. The merge height here is the square root of twice that increase, the same scale as SciPy linkage(method="ward") and R hclust(method="ward.D2"). It is not the scale of R "ward.D".
- When two pairs are exactly equally close, this page joins the pair that comes first in your input order. Other software may break such ties differently and give a different tree.
Choosing a distance and whether to standardize
- Euclidean distance is the straight-line distance between two items. Manhattan distance adds up the absolute differences, so a single large difference weighs less.
- 1 − Pearson correlation ranges from 0 to 2 and compares the shape of two profiles. Items with parallel profiles at different levels are at distance 0. It is undefined for an item whose values are all the same.
- If your variables are in different units or very different ranges, the largest ones dominate Euclidean and Manhattan distance. Z-scoring each table column (subtract the mean, divide by the sample standard deviation) puts them on a common scale.
- Z-scores are applied to the columns of the pasted table, whether you then cluster the rows or the columns.
A dendrogram is not necessarily a phylogenetic tree
Both are drawn as branching trees, but they answer different questions. A clustering dendrogram groups items by overall similarity in the numbers you supply. A phylogenetic tree is a hypothesis about common ancestry, usually inferred from sequence or character data with a model of evolution. UPGMA has been used to build phylogenies, but it assumes a constant rate of change across lineages. Do not read ancestry from a clustering of body measurements or expression values.
Newick and cluster exports
- The Newick file keeps the tree shape and heights so you can restyle it in tree-viewing software. A name made only of English letters, digits and the characters . + - | is written as is. Any other name, for example one with a space, underscore, bracket, colon or comma, is wrapped in single quotes, and a quote inside it is doubled.
- Each branch length is the parent merge height minus the child height, with leaves at 0. A leaf is therefore one root height from the root, and the path between two leaves is twice the height at which they join. Lengths are not halved.
- The cluster CSV lists every item with its cluster number and its position in the drawn leaf order.
Writing it up in your methods
- Report what was clustered, any transformation or standardization, the distance, the linkage and how clusters were cut.
- Example: "Samples were clustered by agglomerative hierarchical clustering using Euclidean distance on z-scored variables (sample standard deviation) and Ward linkage (ward.D2 scale). The dendrogram was cut into three clusters." Replace each choice with the one you actually used.
Limits
- Clustering always returns a tree, even for data with no real group structure.
- The result depends on the distance, linkage and scaling. Check whether your conclusion survives another reasonable choice.
- Up to 200 items can be clustered. Missing and non-numeric values are rejected, not filled in.
- No bootstrap or other support values are calculated.
Frequently Asked Questions
Reference for the linkage definitions and the Ward height scale: the SciPy linkage documentation, and Murtagh F, Legendre P. Ward's hierarchical agglomerative clustering method: which algorithms implement Ward's criterion? J Classif 2014;31:274-295.


