How Screen Readers Read Image Alt Text
A screen reader can't look at a picture. It reads out whatever text the page supplies for that picture, and if the page supplies none, the listener gets a gap or a guess.1
What a screen reader is
The program turns what's on the screen, text and images alike, into speech or braille.2 Wikipedia calls screen readers essential to blind people. It adds that they're also useful to people who are visually impaired.2
Alt text isn't only for them, though. WebAIM reminds authors that alternative text isn't just for users who are blind.1
What happens at an image
When a screen reader reaches an image with alt text, it reads the text out in place of the image. Wikipedia names Orca as one program that does this.3
WebAIM says screen readers already announce "graphic" along with the alt text. That's why starting your own text with "image of" just says it twice.1
The three cases look like this:
| What the image has | What a screen reader may do |
|---|---|
| Alt text with words | Reads the words in place of the image1 |
| An empty alt attribute | Can skip the image, so the listener isn't slowed down by it34 |
| No alt attribute | Some may announce the file name instead4 |
A file name like IMG_final_v2.jpg tells a listener nothing. That's the gap. Linked images need care. If the image is all a link contains and its alt is empty or missing, WebAIM says a screen reader might read the file name or the linked page's address. That is not always helpful. A linked image with proper alt text is read by its alt text.1
Reading it in context
Alt text isn't heard on its own. It's read in the middle of the sentences around it, so it has to fit.
MDN gives an example. Suppose a sentence says "On my travels, I saw a cute little animal:" and the next thing is an image with the alt text "image". A screen reader could read that as the sentence followed by the word "image".4 That makes no sense. Alt text that names what's in the photo does.
This is also why the HTML standard says the alt text should not repeat information already given in the prose next to the image.5 The listener hears both, one straight after the other.
Links and buttons
An image inside a link gets read as part of the link. WebAIM's logo example is a company logo linked to the home page. A listener would hear "Link, Graphic, Acme Company" at the top of the page, which WebAIM says is enough to tell them it's a logo linked to the home page.1
People also move through a page by jumping from link to link. WebAIM notes that a linked image may be reached in isolation from the adjacent text, such as when a screen reader user is navigating by links. So the alt text on a linked image has to make sense alone.1
There's more on this in alt text for logos, icons and image links.
Decorative images
Some images give a listener nothing worth hearing. For those, an empty alt="" lets the screen reader move straight past. Wikipedia describes the empty attribute as making a page easier to move through by skipping over images that don't convey any meaning.3 The page on telling decorative images apart shows how to spot them.
Reference list
- WebAIM: Alternative Text, WebAIM, Utah State University
- Screen reader, Wikipedia
- alt attribute, Wikipedia
- <img>: The Image Embed element, MDN Web Docs, Mozilla
- HTML Standard, the img element and alternative text, WHATWG