By Tim King · Updated
Colour Scale Generator
Continuous, Stepped and Category Colour Keys for Maps, Heatmaps and Dashboards
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Colour Scale And Legend Generator works
This colour scale generator builds legends for maps and charts. A map, heatmap or dashboard needs a legend that says what the colours mean. Enter the low and high values of your data and this page draws a colour bar, either a smooth gradient or a set of stepped bins, with tick labels along it. Enter a list of category names instead and you get a swatch legend. Pick a scheme, set the orientation, download as SVG or PNG, and read the exact hex value at each stop from the stats panel. Nothing is uploaded.
Colour scale generator: numeric scales
Type two numbers, such as 0 100 or -20, 40, and the page treats them as the range of the
data. Continuous draws a single gradient bar with evenly spaced ticks. Stepped divides the range
into the number of bins set by Steps and draws one flat block per bin, with a tick at every
boundary, which is what a choropleth map or a classed heatmap needs. The stats panel lists the
colour at each tick or bin so you can copy the same hex values into the chart itself and keep
the legend and the data in step.
Choosing a scheme
Viridis, Inferno, Plasma, Cividis and Turbo are perceptually uniform, meaning equal steps in value look like equal steps in colour, and the first four remain readable when printed in greyscale or viewed with colour vision deficiency. The single-hue ramps such as Blues or Reds suit a scale that starts at nothing and grows. The diverging schemes, red to blue and the rest, put a neutral colour in the middle and are for data with a meaningful centre, such as change from a baseline, temperature anomaly or profit and loss. Chart palette blends the first five colours of the palette chosen in the chart settings, which keeps the legend consistent with the other charts on this site. Direction flips any scheme so the strong colour sits at the low end if that reads better for your data.
Category legends
Enter one label per line and the page draws a swatch beside each, wrapping into columns when
the list is long. Colours come from the chart palette in order, so a legend made here matches a
bar or pie chart drawn with the same palette. To set colours yourself, follow each label with a
comma and a hex value or CSS colour name, such as Rail, #1c7ed6. Mixed lines are fine; any
line without a colour takes the next palette colour.
Layout
Horizontal puts the bar across the page with ticks beneath it, the usual choice for the bottom of a map or heatmap. Vertical stands it up with ticks on the right, for a legend down the side of a tall figure. Axis label adds a caption such as "Rainfall (mm)" below or alongside the bar, and the Title field above the chart adds a heading.
Exporting
Download SVG gives a vector legend with real text that can be dropped into Illustrator, Inkscape, Figma or a report and resized without loss. Download PNG renders at one, two or three times the preview width. Copy SVG puts the markup on the clipboard for pasting into a web page or another SVG.
FAQ
Can I set my own start and end colours?
Not as two free colours in this version; choose the closest scheme, or use Chart palette and set the palette in the chart settings. For a two-colour ramp between exact hex values, the tint and shade scale tool in the related list builds one from a single base colour.
Why are the stepped bins not round numbers?
Bins divide the range you typed into equal parts, so a range of 0 to 100 in seven steps gives boundaries at 14.3, 28.6 and so on. Change the range or the step count so the divisions fall on round values, for example 0 to 105 in seven steps or 0 to 100 in five.
Does the legend match the colours in my chart?
Only if the chart uses the same scheme and range. The stats panel lists the hex at every stop or bin edge; use those exact values in your charting tool, or paste your data into a chart maker on this site with the same palette so both are drawn from one source.
Can I use it for a map legend?
Yes. A stepped scale with five to seven bins is the standard choropleth legend. Download as SVG and place it on the map in your mapping or drawing tool, or as PNG for a slide.
See also: all Chart Makers tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.
Related tools
Colour Palette Generator
Generate a full UI palette with light and dark modes from one colour.
Tint & Shade Scale
One brand colour into a full 50–950 palette scale.
Palette Extractor
Pull the dominant colours out of a photo as hex codes.
Bar Chart Maker
Paste CSV, get a grouped or stacked bar chart; download SVG or PNG.
SVG To PNG
Rasterise an SVG to a PNG at any width.