Skip to content

Alt Text for Charts, Graphs and Diagrams

Last checked 18 November 2026

A chart can hold a lot of numbers. An alt attribute can't. The way out is to split the job in two: a short label on the image, and the full detail somewhere on the page.

Why the alt text stays short

Complex images are charts, graphs, maps and the like. WebAIM says that when the equivalent won't fit in a succinct alt attribute, perhaps a couple of sentences, it must be provided elsewhere.1

The HTML standard says a chart or diagram can be an image, but the lesser textual version must still be given.2 It also says the alternative text is a replacement for the image, not a description of it.2 But the two sources differ on where the detail goes. The standard says the text must be given in the alt attribute and must convey the same message as the image.2 WebAIM says detail that won't fit in a succinct alt attribute goes elsewhere.1

Where the detail can go

WebAIM suggests an adjacent data table on the same page, or a separate page linked from the image or from a text link beside it.1

GOV.UK's guidance is written for its own publishing system. There, editors leave the alt text field blank and instead add at least one of these:3

  • a description of the chart directly under it
  • a table of the raw data
  • a link to the raw data in an accessible file

That is GOV.UK's pattern, not a short alt text plus detail. The short alt text plus detail pattern below comes from WebAIM only.1

If you provide the raw data as a table, GOV.UK says to consider if it will be clearer than a description. For a long time series, it says a description of the trends will be more appropriate than a table.3

Describing a chart or diagramWork out the message of the imageWrite short alt text: type and topicPut the full detail in the page textOr add a data table or a link to data
Short alt text on the image, detail on the page.

Writing the short alt text

WebAIM says the alt text should still describe the general content of the image.1 Its example is a line chart with the alt text "Line chart of annual sales data", sitting above a link to the data page.1

<img src="sales.jpg" alt="Line chart of annual sales data">
<a href="salesdata.htm">View sales data</a>

That's the whole pattern. The image says what kind of thing it is and what it's about. The link or table does the rest.1

Writing the longer description

GOV.UK tells writers to imagine they're describing the chart to someone over the phone.3 Two warnings come with that.

Don't just repeat the chart's headline title.3 And don't describe the chart vaguely. Saying what's on each axis isn't enough. Explain what is happening in the data and any important trends.3

GOV.UK also says not to rely on colour alone to convey information.3 Someone who can't tell two colours apart still needs to know which line is which.

Diagrams and flowcharts

For a diagram, GOV.UK says to put a detailed explanation of the processes and relationships in the body text, for readers who can't see it.3

The HTML standard works a flowchart example. Its alt attribute restates the whole flowchart in prose, step by step, saying what passes data to what.2 That is different from WebAIM's short alt text with the detail elsewhere.

There's a catch. If the text right beside the image already says the same thing in full, the image only repeats it. The standard says that in that case the alt attribute must be present but its value must be the empty string.2 Pick one place to say it. The page on empty alt text has more.

Infographics

GOV.UK warns that infographics can be hard to make accessible if they're too complicated. If you do use one, it says you should provide a plain text version of the content.3

One thing to skip

You may come across the longdesc attribute in older advice. WebAIM says it's deprecated and shouldn't be used.1

Reference list

  1. WebAIM: Alternative Text, WebAIM, Utah State University
  2. HTML Standard, the img element and alternative text, WHATWG
  3. Images, GOV.UK content and publishing guidance, Government Digital Service, UK