Skip to content

What Is Alt Text? A Plain Explanation

Last checked 18 November 2026

Alt text is a short written stand-in for an image. It lives in the alt attribute of the image tag, and it gets used whenever the picture itself isn't seen.1

A little jargon first. HTML is the code that tells a browser what's on a page. A tag is one instruction in that code, and img is the tag that puts an image on the page. An attribute is an extra setting inside a tag. So the alt attribute is a setting on the img tag, and it holds the stand-in words.2

What it looks like

<img src="penguin.jpg" alt="A penguin on a beach.">

The src part names the image file. The alt part holds the replacement text. MDN, Mozilla's web documentation, says you need at least those two attributes on every image tag. It describes alt as text that can replace the image in the page.2

Where the text shows up

Most visitors never see it. A graphical browser typically shows only the image.3 The text turns up in these places:

  • Screen readers. A screen reader is software that renders text and image content as speech or braille. It announces the alt text in place of the image.41
  • Text-only browsers. They show or read the alt text instead of the image.3
  • Pages where the image fails to load. MDN lists network errors, content blocking and link rot as reasons.2
  • Search engines. WebAIM says they use alt text when they judge what a page is about.1
  • Copy and paste. MDN says the text is also used when an image is copied as text or a linked image is saved as a bookmark.2
What happens to alt textPage has an img tag with alt textBrowser tries to load the imageLoaded: most visitors see the pictureNot loaded: the text is shown insteadScreen reader: the text is read aloud
The same attribute serves several readers.

A stand-in, not a caption

The HTML standard gives one test. Swap every image for its alt text, and the meaning of the page shouldn't change.5

It offers a second way to think about it. Picture yourself reading the page aloud to someone over the phone, without saying there's an image. Whatever you'd say in place of the picture is a good start.5

That's why alt text isn't a caption. A caption adds to a picture. Alt text takes its place. The standard says the value should never contain text that could be considered the image's caption.5

Software can't do this job for you. WebAIM points out that algorithms alone can't understand what an image means within the context of the whole page. A maple leaf might stand for a country, or it might just be a leaf.1

Three states an image can be in

Every image on your site ends up in one of three states.

  • Words in the attribute. For images that carry content or do a job. How to write good alt text covers the method.
  • An empty attribute, written alt="". For images that add nothing. Decorative images and empty alt text explains when.
  • No attribute at all. Some screen readers may announce the image's file name instead, which can confuse a listener.2

WebAIM's rule is that every image should have an alt attribute, even if it's empty.1 The exact code is on how to add alt text in HTML, and how screen readers read alt text covers what the listener hears.

Reference list

  1. WebAIM: Alternative Text, WebAIM, Utah State University
  2. <img>: The Image Embed element, MDN Web Docs, Mozilla
  3. alt attribute, Wikipedia
  4. Screen reader, Wikipedia
  5. HTML Standard, the img element and alternative text, WHATWG