Data visualization color palettes
Generate chart colors that stay readable for everyone. Categorical sets maximize the smallest difference under normal vision, protanopia, deuteranopia and tritanopia. Sequential and diverging scales are even in OKLab, with lightness doing the ordering.
How to make a chart color palette
- Choose the palette type: categorical for unordered groups, sequential for values from low to high, or diverging for values around a midpoint.
- Set how many colors you need, 2 to 12 for categorical and 3 to 11 for sequential and diverging, and whether the chart background is light or dark.
- Optionally add up to three brand or seed colors. A categorical palette keeps your colors and chooses the rest to stay apart from them.
- Check the live chart previews and the color-vision views, then export the colors as D3, Vega-Lite, Matplotlib, ECharts or ggplot2 code, or as JavaScript, CSS variables or Tailwind v4.
What you can do
Color-blind-safe categories
Categorical colors are chosen to stay distinguishable under normal vision, protanopia, deuteranopia and tritanopia at the same time.
Even sequential and diverging scales
Lightness runs one way along a sequential scale, and a diverging scale is symmetric around a neutral midpoint.
Contrast against your background
Categorical colors keep 3:1 contrast against the chart background, the WCAG minimum for graphical objects.
Live chart previews
See bar, line, scatter, donut, area, heatmap and tile-map charts drawn in your colors.
Warnings
The page flags colors that are hard to tell apart, scales that are uneven and colors with low contrast.
Chart-library export
Copy ready-made code for D3, Vega-Lite, Matplotlib, ECharts and R ggplot2, or plain hex values.
Frequently asked questions
What is a data visualization color palette?
A set of colors chosen for charts rather than decoration. The three kinds are categorical palettes for distinct groups, sequential palettes for ordered values, and diverging palettes for values that move away from a midpoint in two directions.
How many colors should a chart use?
For categorical data keep it to about eight or fewer. Past eight, the differences get small, especially for color-blind viewers, so consider direct labels or grouping some categories.
How do I make a color-blind-friendly chart palette?
Choose colors that differ in lightness as well as hue, and test them under protanopia, deuteranopia and tritanopia. This generator maximizes the smallest difference between any two colors across those views and shows each one. Add labels or patterns where you can.
Should I use a sequential or a diverging palette?
Use sequential for values that run from low to high, such as counts or rates. Use diverging when the values have a meaningful middle and go in two directions, such as change, deviation or sentiment.
Can I use these colors in D3, Matplotlib or ggplot2?
Yes. The export panel produces code for D3, Vega-Lite, Matplotlib, ECharts and R ggplot2, plus a JavaScript array, CSS variables and a Tailwind v4 theme.