Article
Accessible colour palettes for data visualisation: charts people can read
- Colour
- WCAG
- Alt text
An accessible chart palette is a set of colours that people can tell apart from the background and from each other. WCAG asks for 3:1 for the parts of a chart you need to see. It also asks that colour isn’t the only way to read the chart.
Colour is only half the job. Label the data on the chart, and give a text version of what it shows.
In short
- Chart parts need 3:1. Lines, bars and slices need a contrast ratio of at least 3:1 against the colours next to them. Chart text needs 4.5:1.
- Don’t rely on colour alone. Put labels on the lines, bars and slices instead of a colour key.
- Start from a tested palette. The UK Government Analysis Function publishes one with every ratio. Use its colours in the order given.
- Every chart needs a text alternative. Give a short description of the chart’s message, a table of the data, or both.
What makes a chart accessible
Copy link to section: What makes a chart accessibleIn an accessible chart, you can tell the parts apart without colour. Its lines, bars and text have enough contrast. And its message is also there as text.
US guides spell these words “color” and “visualization”. This page uses the UK spelling, except in the names of WCAG rules.
Colour work often focuses on colour blindness. The Analysis Function says people with low vision, from conditions like glaucoma and cataracts, need thought too. Colour blindness has the types and how common each one is.
Which WCAG rules apply to charts
Copy link to section: Which WCAG rules apply to chartsSix WCAG 2.2 rules cover most chart problems. Two are about contrast, two are about colour and wording, and two are about text. The Analysis Function names all six for charts in UK public sector work, where content must meet WCAG 2.2 at levels A and AA.
| Rule | Level | What it means for a chart |
|---|---|---|
| 1.4.11 Non-text Contrast | AA | Lines, bars, slices and markers you need to see have 3:1 against the colours next to them |
| 1.4.3 Contrast (Minimum) | AA | Text in and around the chart has 4.5:1, or 3:1 if it’s large |
| 1.4.1 Use of Color | A | Colour isn’t the only way to tell the data apart |
| 1.3.3 Sensory Characteristics | A | Instructions don’t depend on colour alone, such as “the green line” |
| 1.1.1 Non-text Content | A | The chart has a text alternative |
| 1.4.5 Images of Text | AA | Text is real text, not part of an image, where it can be |
What are WCAG compliant colours?
No single colour passes or fails WCAG on its own. WCAG checks pairs of colours. A chart part needs 3:1 against what’s next to it. Chart text needs 4.5:1 against its background, or 3:1 for large text. So a colour can pass on white and fail next to another bar.
Here’s how a pair works. Black on white is 21:1, the highest ratio there is. The Analysis Function’s orange, #F46A25, on white is 3.028:1. That passes 3:1 for a bar or a line. It fails 4.5:1 for small text.
W3C says the ratios are not rounded. A pair at 2.999:1 doesn’t meet 3:1.
Large text is at least 18 point, or 14 point if it’s bold. The accessible colour palettes guide covers text contrast and UI colours in full.
Contrast for chart colours
Copy link to section: Contrast for chart coloursUnder 1.4.11, each part of a chart that you need to see to understand it needs 3:1 against the colours next to it. That covers lines, bars, slices, markers and the lines that mark values. W3C’s Understanding 1.4.11 page works through line graphs, pie charts and infographics as examples.
The rule exists because people with low vision often struggle to see low contrast graphics. A colour vision deficiency can lower the contrast even more.
Lines and bars against the background
In W3C’s line graph example, each line needs 3:1 against the background. The lines barely overlap, so they don’t need 3:1 against each other or against the grey gridlines.
When a chart has more than two lines, put contrast with white first. Then people can see every line, even if they can’t tell the colours apart.
Colours next to each other
Bars in a stack and slices in a pie touch each other. So each one needs 3:1 against its neighbours as well as the background.
In W3C’s failing pie chart, each slice has a label, so it passes 1.4.1. But you still have to see where one slice ends and the next begins, and the slices don’t have 3:1 against each other. The passing version adds a darker border around the yellow slice.
A white border around each slice helps for the same reason. With more than two colours, you can’t give every colour 3:1 on white and also 3:1 against every other colour. So some pairs will be close. In stacks and pies, order the colours so those pairs don’t touch.
When chart parts don’t need 3:1
A chart part doesn’t need 3:1 if the same information is there another way. W3C gives these cases:
- Text on the chart gives the same information, such as labels and values.
- The graphic is only there to look good.
- The information is in another form, such as a table after the chart.
W3C’s second pie chart shows the first case. Each slice has a visible label and value, so slice contrast doesn’t apply. W3C still says any text inside a graphic must meet 1.4.3.
The Analysis Function reads 1.4.11 more strictly. It says all colours next to each other need 3:1, unless the look is essential to the message. If you can meet that, do. If you can’t, labels, values and a data table are W3C’s own way through.
Axes, gridlines and labels
Use colour only for the data, such as lines and bars. The Analysis Function recommends a grey with 3:1 on white for axes and axis labels. It says the Microsoft default axis grey, #595959, is fine. That grey is 7.004:1 on white.
For gridlines, the Analysis Function gives its own opinion that they don’t need 3:1, because too dark makes a chart hard to read. The Microsoft default, #D9D9D9, is 1.411:1 on white. W3C’s line graph counts value lines among the parts to check when you need them to read values. So if readers need the gridlines, give the values another way too, such as labels or a table.
For labels on lines and slices, black or very dark grey works best.
Charts that change on hover or focus
Some charts show values or raise the contrast when you point at them, tap them or move focus to them. W3C says the chart must already have enough contrast before that happens. Otherwise people may not know the parts are there at all. Beyond that line, the sources here don’t cover interactive charts.
Don’t rely on colour alone
Copy link to section: Don’t rely on colour alone1.4.1 Use of Color says colour can’t be the only visual way to tell things apart. W3C’s Understanding 1.4.1 page says this shouldn’t stop you using colour, or colour coding, as long as something else backs it up.
A chart that shows its data by colour alone fails three rules at once. W3C documents this as failure F13, which names 1.1.1, 1.3.3 and 1.4.1.
W3C also says showing colour information to a screen reader isn’t enough. Sighted people who can’t tell colours apart may not use one, so the cue has to be visible.
Label the data directly
A legend, or colour key, makes people match labels to data by colour. The Analysis Function’s checklist marks this as essential. Avoid legends in line and pie charts, and label each line and slice on the chart.
For line charts, put the label at the right-hand end of each line, in black or dark grey text. Use coloured label text only when lines are so close that you can’t tell which label goes with which line.
Stacked and clustered bar charts sometimes need a legend. If yours does, match its order and direction to the bars. Then say how it’s laid out just above the chart. With horizontal clustered bars, label the first cluster instead.
Don’t write “the green line” in the text around a chart either. That leans on colour too.
Shapes, line styles and patterns
Shapes on data points and dotted or dashed lines can help tell series apart. W3C’s line graph example uses lines and shapes for each group.
Use them with care. Big or overused markers clutter a chart. Dotted lines can look like a forecast, a target or data that isn’t final. Patterns and textures count as clutter to avoid, too. So label first, and add shapes or line styles only when you need more.
Red and green
W3C counts a change of hue as a visible difference only when the lightness difference gives 3:1 or more. So a red and a green that are about as light as each other don’t count. If people have to name a particular colour, such as green for good and red for bad, they need another visual cue anyway.
The Analysis Function says you can’t pick red, amber and green shades that all have enough contrast against white and against each other. Its amber, #FFC000, is 1.641:1 on white, and its green, #8ED973, is 1.704:1. Both are under 3:1 for a chart part.
So for a red, amber and green (RAG) status, use a table column. Fill each cell with the colour and write what it means in the cell. Then check the text against the fill. Black on that amber is 12.791:1.
Which colours are worst for colour blindness has more on the colours people mix up.
How many colours should a chart use?
Copy link to section: How many colours should a chart use?Four colours is best practice for most charts, with a fifth and sixth only when you can’t avoid them. Pie charts should have five slices or fewer. WCAG itself sets no number.
If the bars don’t need to be grouped, make them all one colour.
For more than four lines, use small multiples, one small chart for each series. Or use a focus chart, which colours one series and greys the rest.
Kinds of chart palette
Copy link to section: Kinds of chart paletteThe Analysis Function publishes three palettes, each for a kind of data. Use a categorical palette for groups with names. Use a sequential palette when the order of the groups means something, such as age bands. Use a focus palette when one series is the story and the rest are context.
All three are built from the GOV.UK Design System colours, changed slightly to raise the contrast. All three are made for a white background. Never put an image behind a chart.
This page doesn’t cover diverging palettes. None of the guidance here defines or tests one.
What’s the best colour palette for charts?
Copy link to section: What’s the best colour palette for charts?No palette is best for every chart. The Analysis Function’s categorical palette is a good place to start, because it’s tested and it lists every ratio. Every colour has at least 3:1 on white. Used in the order given, each colour has at least 3:1 with the next one. And the colours passed its checks for colour blindness and greyscale.
The categorical palette
Use the colours in this order. The ratios come from a contrast check on each hex value, and they match the figures the Analysis Function gives.
| Order | Colour | Hex | On white | With the next colour |
|---|---|---|---|---|
| 1 | Dark blue | #12436D |
10.246:1 | 3.237:1 |
| 2 | Turquoise | #28A197 |
3.165:1 | 3.088:1 |
| 3 | Dark pink | #801650 |
9.774:1 | 3.227:1 |
| 4 | Orange | #F46A25 |
3.028:1 | 3.587:1 |
| 5 | Dark grey | #3D3D3D |
10.862:1 | 3.523:1 |
| 6 | Light purple | #A285D1 |
3.082:1 | none |
The order is what makes it work. Out of order, some pairs are close to the same lightness. Dark blue next to dark pink is 1.048:1. Turquoise next to orange is 1.045:1.
Dark grey and light purple were added because people asked for more colours. Use them only when you can’t avoid it.
Turquoise, orange and light purple are under 4.5:1 on white. They’re fine for bars and lines, but not for small text.
For a chart with one colour, the Analysis Function uses dark blue. For two, it uses dark blue and orange, at 3.383:1. It calls them the highest contrast colours in the palette, but that holds only among the first four. Dark grey has more contrast with white than dark blue does, and orange with dark grey is a higher pair.
The sequential palette
Sequential data uses one hue, or a few close ones, going from pale to dark. The Analysis Function’s blues follow that idea. But only its darkest, dark and mid blue have 3:1 on white. Mid blue, #2073BC, is 4.952:1. Light blue, #6BACE6, is 2.422:1, and lightest blue, #ADD1F1, is 1.594:1.
Several blues next to each other also fall short of 3:1. So it uses this palette only when nothing else works. And it always adds the data another way, such as a table people can download.
Its tip for bars in light blues is a dark blue outline on every bar. The outline shows where each bar ends.
The focus palette
A focus chart colours one series and greys the rest. The palette pairs dark blue with a light grey, #BFBFBF. The grey has 1.838:1 on white, which is under 3:1. Dark blue on that grey is 5.572:1.
So the grey lines are context, and the dark blue line is the message. This page’s own tip is to make that line a little thicker. Then say the message in the text. The grey is pale against white, so some people may not see those lines.
Brand colours
Brand colours often fail these checks. If you have to use them, give colours next to each other 3:1 where you can. Label the data directly. Then give a text version, such as a data download and a written description.
If your colours change from chart to chart, people lose track. Give the same thing the same colour in every chart in a series.
How to make an accessible colour palette
Copy link to section: How to make an accessible colour paletteFollow these five steps to pick your own palette. Steps 2 to 5 also check a palette you already have. Do them in order, because a palette that passes step 3 can still fail without step 2.
- Find a starting palette with a tool. The Analysis Function names ColorBrewer, ColorHexa and Adobe Illustrator. This page hasn’t tested them.
- Plan for colour not being the only cue, and plan a text alternative. Do this even if the colours pass.
- Check every pair of colours that will sit next to each other. Each pair needs at least 3:1.
- Check the palette for the main types of colour blindness.
- Check it in black and white, for example with print preview.
The Analysis Function names WebAIM’s contrast checker, and the coloratio package for R, for step 3. For step 4, it names Adobe’s colour tool, Coblis and the ColorBlindCheck package for R, among others (this page hasn’t tested any of these).
It calls step 5 less important for charts that only appear on screen. Its main guidance says to check every chart in greyscale, because it shows when a chart relies on colour. Do it every time.
Text alternatives for charts
Copy link to section: Text alternatives for chartsA chart is a complex image, and 1.1.1 says it needs a text alternative. The Analysis Function says this applies even when the colours pass. The alternative can be a short description of the chart’s message, a table of the data, or both. Give a table if people would read values off the chart. Give a description if they’d take away a trend.
Alt text covers how to write alt text in general. Its section on complex images goes into charts.
W3C’s two-part approach
W3C’s complex images tutorial asks for two parts. A short alt says what the image is, and where the long description is. The long description then gives the important information in text.
The long description can cover how the chart is built, such as the order of the colours and the heights of the bars. It also gives the values and the trends. W3C says to make it available to everyone, for example in the main text.
W3C’s example short alt for a bar chart is “Bar chart showing monthly and total visitors for the first quarter 2025 for sites 1 to 3”. It gives three ways to link the two parts. You can put a link to the description next to the image. You can say in the alt where the description is. Or you can put the image and its description together in one figure.
The description in the page text
The Analysis Function puts the description in the page text, right under the chart. Many people need it, and an alt attribute is hard to reach unless you use a screen reader.
It starts the description by naming the chart type, such as “a line chart showing”. It says what readers should take away. It doesn’t describe every data point or repeat the title.
It then marks the chart image as decorative, with an empty alt. A screen reader then goes from the chart title straight to the description.
The two sources part ways on the alt. W3C asks for a short alt that names the chart and points to the description. That’s the stricter choice, so use it. Then put the description in the page text, where everyone can read it.
Titles, sources and data downloads
The Analysis Function’s checklist marks these as essential for a published chart:
- Give every chart at least one title. Start it with “Figure 1” and so on, so screen reader users know a chart is coming.
- Mark chart titles as headings.
- Put the title, the source and any notes in the page text, not in the image.
It also asks for a data download under each chart, in a format such as ODS or Excel that people can open. Make the link text say what it is, such as “Download the data for figure 1 (ODS, 5KB)”.
SVG, HTML or an image
If your site can build charts in HTML that meet the rules, use that. Otherwise, save the chart as SVG. An SVG stays sharp at any zoom or screen size, unlike a JPG or PNG. Save it as SVG from the program that made the chart, because converting a PNG doesn’t make it sharp.
Chart labels can stay inside the image. The Analysis Function counts them as text that’s essential to the image. W3C doesn’t say this, so put any message the labels carry in the description too.
How can I check if my chart colours are accessible?
Copy link to section: How can I check if my chart colours are accessible?Check the colours in pairs first. Then check the chart without colour, and check the text version. W3C’s own test for chart parts is a good frame. Find each part you need to understand the chart, and check it against the colours next to it.
- List each part of the chart you need to see to understand it. Leave out parts that a label or value already explains.
- Check each part against the colours next to it. Where a part has several colours or a gradient, check the area with the least contrast.
- If that area is under 3:1, picture the chart without it. If you can still understand the chart, it passes. If you can’t, it fails.
- Check every piece of chart text for 4.5:1, or 3:1 if it’s large.
- View the chart in greyscale. If two series look the same, add labels or change the colours.
- View it with a colour blindness simulator.
- Read the page without the chart. The title, the description and the data should still give the message.
Colour blindness has the steps for the simulator built into Microsoft Edge. For a free checker, accessibility testing tools compares the options. Show the chart to colleagues who haven’t worked on the data, too.
Charts are one row in a full review. The accessibility audit checklist lists the colour, contrast and image checks around them.
Accessibility Testing runs accessibility audits that end in a written audit report against WCAG 2.2 AA.
I've designed products for more than ten years, leading accessibility and design system work for product teams. I also built Perception, a Figma plugin that checks contrast while you design.
Sources
Every rule and palette on this page comes from these primary sources.
- W3C, Understanding Success Criterion 1.4.11: Non-text Contrast
- W3C, Understanding Success Criterion 1.4.1: Use of Color
- W3C, Understanding Success Criterion 1.4.3: Contrast (Minimum)
- W3C, Complex images tutorial
- Government Analysis Function, Data visualisation: colours
- Government Analysis Function, Data visualisation: charts
- Government Analysis Function, Charts: a checklist