01
How to make a heatmap
- Paste your table, or open a CSV. Put the row names (genes, samples, compounds) in the first column and the column names in the first row. A block copied from Excel works as it is.
- Choose the scale. For expression data, z-score each row so every gene is compared on its own range; for variables measured in different units, z-score each column.
- Keep “Cluster rows” and “Cluster columns” on to group similar profiles, and pick the linkage and distance.
- Download the SVG to edit in Illustrator, Inkscape or PowerPoint, or the PNG for a manuscript, and copy the figure legend.
02
Row z-score, column z-score or raw values?
| Scale | Each cell shows | Use it for |
|---|---|---|
| Z-score each row | how far a value is from its row’s mean, in standard deviations | gene or protein expression: which samples are high or low for each gene |
| Z-score each column | how far a value is from its column’s mean | variables in different units, such as weight, age and a lab value |
| None | the number you entered | data already on one scale, such as percentages or correlations |
z = (value − mean) ÷ SD
Without scaling, the variable with the biggest numbers takes over the colour range and the rest look flat. The SD is the sample SD, as in R’s scale(). Z-scores are centred on zero, so they are drawn with a blue–white–red scale where white means average.
03
Clustering and dendrograms
Hierarchical clustering joins the two most similar rows, then the next most similar pair or group, until everything is joined. The dendrogram records the order: rows joined by a short branch have similar profiles, and the height of a join is the distance at which the two groups merged.
| Choice | Option | What it does |
|---|---|---|
| Distance | Euclidean | compares the values themselves; the default in R’s dist() |
| Distance | 1 − Pearson correlation | compares the shape of the profiles, ignoring their level; common for expression data |
| Linkage | Complete | distance between groups is the largest pairwise distance; the default in R’s hclust() |
| Linkage | Average (UPGMA) | the mean pairwise distance; less sensitive to single outliers |
| Linkage | Single | the smallest pairwise distance; tends to chain rows together |
Clustering uses the values as they are drawn, after scaling. R’s base heatmap() clusters the unscaled values and only scales the colours, so its order can differ from this tool’s when the columns have very different ranges.
04
Choosing colours
- Blue–white–red (ColorBrewer RdBu) for values centred on zero: z-scores, fold changes on a log scale, correlations.
- Viridis for values that run from low to high: it changes evenly in lightness and stays readable in greyscale and for the common forms of colour blindness.
- Avoid red–green scales: red–green colour blindness is the most common kind.
- Missing values are grey with a diagonal stroke, not a colour.
05
The example data
The example is mtcars, the 32 cars by 11 measurements that ship with R in its datasets package. It is the data R’s own help page for heatmap() uses, with column scaling, so you can compare this tool’s output with R’s. Replace it with your own table: names in the first column, column names in the first row.
06
File formats
- The SVG keeps every cell as a rectangle and every label as text, so you can recolour, rename or rearrange it in a vector editor.
- The PNG is rendered at about 2,700 pixels wide, 9 inches at 300 dpi.
- Up to 300 rows and 80 columns are drawn; labels are hidden when rows get too thin to read.
07
Why many heatmaps mislead
- No scaling. In the mtcars example, engine displacement runs up to 472 and rear axle ratio up to 4.93. Coloured raw, displacement takes the whole colour range and the other ten columns look flat.
- A diverging scale that is not centred. Blue–white–red only works when white means zero or average; this tool makes the scale symmetric around zero for z-scores.
- Rainbow and red–green palettes. They change brightness unevenly and fail for the most common colour blindness; viridis and blue–white–red do not.
- Clustering that silently differs. R’s base heatmap() clusters the unscaled values and scales only the colours; this tool clusters what it draws, and says so in the legend.
Sources: R heatmap() documentation; mtcars in the R source.
Trust
How this page is checked
- The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
- Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.
Cite this page
Sciloom. (2026). Heatmap maker. Zebra Nine Studio Inc. https://sciloom.si/heatmap-maker
Frequently asked questions
How do I make a heatmap of gene expression?
Paste a table with genes as rows and samples as columns, choose “Z-score each row”, and cluster rows and columns. Use log-transformed values (for example log2 counts per million) rather than raw counts, so a few very high genes do not dominate.
Can I make a heatmap without clustering?
Yes. Untick “Cluster rows” and “Cluster columns” to keep the order of your table, for example time points or doses.
Can I make a correlation heatmap?
Yes. Paste a correlation matrix with the same names across the top and down the side, choose no scaling, and keep the blue–white–red colours so −1, 0 and 1 read at a glance.
Can I edit the heatmap afterwards?
Yes. Download the SVG and open it in Illustrator, Inkscape, Affinity Designer or PowerPoint. Each cell is a separate shape and each label is text.
Is my data uploaded?
No. The heatmap and the clustering are calculated in your browser, and a CSV you open is read on your computer.