Write alt text to say what an image adds to the page, not to list everything in it. If the image carries information, give it one short sentence. If it is only decoration, leave the alternative text empty (alt="") so a screen reader skips it.

That one choice, describe or skip, covers most images. The rest of this page shows how to make it quickly, how long to write, and where to type the text on a web page or in a document.

Three questions to ask first

The W3C's image tutorial sorts images by purpose. These questions follow that sorting. Ask them in order.

  1. Is the image a link or a button? Then the alt text should say where the link goes or what the button does. The link text guide covers the words around it.
  2. Does the image add meaning to the page? If yes, describe that meaning briefly. If it is a graph or other complex information, put the full information in the page text as well.
  3. Is it decoration, or already described by nearby text? Then use an empty alt attribute.

The decision belongs to the author. The W3C notes that the same photo can be informative on one page and decorative on another, depending on why it was included.

What to write for each kind of image

ImageWhat to writeExample
Photo that adds meaningOne short sentence about the pointA volunteer hands a leaflet to a visitor at the information table.
Decorative border or mood photoNothing, an empty altalt=""
Icon inside a buttonThe action, not the picturePrint this page
Linked logoWhere the link goesHome page
Chart or diagramA short summary, plus the details in the page textBar chart of room bookings by weekday. Details follow in the text.
Image of textThe same words as in the imageClosed on public holidays

The W3C's tutorial gives the printer example: a printer icon used for printing should be described by its function, not by what it looks like. For decorative images it asks for a null alt value, not a missing attribute. If the attribute is missing, some screen readers announce the file name instead.

Writing a good description

Describe the purpose, not the pixels. The W3C says informative alt text should convey the meaning of the image, which is typically not a literal description. A detailed literal description is needed only when the visible content itself is the information.

Context changes the answer. The W3C's own example is a bird: its exact kind matters on a site about birds, and matters much less on a site about parks.

For length, aim for one short phrase or sentence. The W3C says informative images convey something that fits in a short phrase or sentence. Microsoft's help page tells you to type one or two sentences. Stop there.

Some habits make alt text better:

  • Start with the point of the image, not with "image of" or "picture of".
  • Use plain words. The shorter sentences guide works here too.
  • Skip anything the nearby text already says. The W3C notes an image can become redundant, and therefore decorative, once the text explains it.
  • Leave out the file name and the camera details.

Before: alt="image1"

After: alt="Thumb pressing the power button on the right edge of the tablet."

Before: alt="magnifying glass"

After: alt="Search"

The second pair follows the W3C rule for functional images. The icon is a button, so its alt text names the action.

Charts and diagrams

A chart holds more than one sentence can carry. The W3C tutorial says a graph or diagram needs a complete text equivalent of its data or information.

So split the job in two. Keep the alt text short and name the kind of chart. Then put the key points or a small table next to it, where everyone can read them.

Before: alt="chart"

After: alt="Bar chart of room bookings by weekday. Tuesday is busiest and Friday is quietest."

The sentence after the chart can then repeat the main finding and list the values.

Where to add it

On a web page, alt text goes in the alt attribute of the img element. Writing alt="" marks the image as decorative.

In Microsoft 365 documents, right-click the picture and choose View Alt Text. You can also select it and use Picture Format, then Alt Text. The help page says to type one or two sentences in the pane. For decoration, tick Mark as decorative instead. Menu names can differ by version.

Some tools can write alt text for you. Microsoft lets you approve generated text if it is satisfactory. Read it first, then fix it by the rules above. Other editors use a similar field, often called "alt text" or "description".

If you plan to export a PDF, write the alt text in the source file first. See making a PDF that reads well on screen. A missing description is also one of the first things in the ten-minute accessibility check.

The Easy-Read Editor can help you keep those sentences short.

Common mistakes

  • Leaving the alt attribute out. Use an empty one for decoration, so nothing is announced by mistake.
  • Using the file name. "IMG_2041" tells nobody anything.
  • Describing a decorative image in detail. It adds noise to the page.
  • Copying the caption word for word. The reader hears it twice.
  • Putting a whole data set in alt text. Move it into the page.
  • Accepting generated text without reading it. Check that it matches the point of the image.

FAQ

How long should alt text be?

One short phrase or sentence is usually enough. Two sentences is a sensible limit.

Do I need alt text for every image?

Every image needs a decision. Either describe it or mark it as decoration. Skipping the decision is the real mistake.

If the logo is a link, describe where it goes, such as "Home page". If it sits beside text that already says the same thing, use an empty alt.

Is alt text the same as a caption?

No. A caption is visible to everyone. Alt text is read aloud by a screen reader, and it can stand in when images are turned off.

Sources

Each page below was opened and read on the date shown. Where a fact comes from one of them, the guide says so.

This guide gives general information about readability. See the Disclaimer. To report a mistake, use the Corrections page.