hexcolors

Learn / Blog / Design

How to choose colors for charts and data visualization

Categorical, sequential and diverging palettes, and how to keep charts readable for everyone.

November 13, 20261 min readBy the hexcolors team

Key takeaways

  • Match the palette type to the data: categorical, sequential or diverging.
  • Keep categorical colors to about five to seven.
  • Label directly and avoid relying on red versus green.

The wrong colors can make a good chart misleading. The right ones make the pattern obvious at a glance. Start by asking what kind of data you are showing.

Categorical palettes

Use these for separate groups, like countries or product lines. The colors should be clearly different from each other with no implied order. Keep them to about five to seven, because people struggle to match more than that to a legend. Beyond seven, group the small categories or use labels.

Sequential palettes

Use these for values that go from low to high. Vary lightness in steps from light to dark of a single hue. Lightness carries the order, which is why a gradient from pale blue to deep blue reads correctly while a rainbow does not. The shade scale generator gives you ready-made steps.

Diverging palettes

Use these when values pass through a meaningful midpoint such as zero or an average. Two hues meet at a light neutral in the middle, for example orange to white to blue.

Avoid the rainbow for ordered data

Rainbow scales have no natural lightness order and exaggerate small differences at some points. Choose a single-hue or two-hue ramp instead.

Design for color blindness

Red and green are the classic problem pair, since they can look alike to many viewers. Use blue and orange instead, vary lightness, and test with the color blindness simulator.

Label directly

Put labels on lines and bars instead of making people look back and forth to a legend. It removes the need to match colors at all. Use gray for context and reserve a strong color for what you want the reader to notice.

Check contrast

Thin lines and small text need enough contrast against the background. Check them in the contrast checker.

The hexcolors teamWe build free color tools and write practical guides. Follow us on X, Instagram and LinkedIn.