The alt attribute

alt provides a text description of an image — for screen readers, for when the image fails to load, and for search engines.

Applies to

img, area, input (type=image)

Values

Free text describing the image's content or function. An empty alt="" is a valid value for purely decorative images.

Example

<img src="chart.png" alt="Sales growth chart for 2026">

Edge cases

  • alt="" (deliberately empty) is correct for decorative images — that's better than having no alt at all.
  • A completely missing alt attribute (not empty, but absent) is an accessibility error caught by automated audits.

Accessibility

  • Don't write "image" or "picture" in alt text — screen readers already announce that it's an img.

Related tools