The alt attribute provides text alternative describing an image's content or function. It serves users and tools that can't see the image.
html
<img src="chart.png" alt="Sales grew 40% from Q1 to Q2" />
The alt attribute provides text alternative describing an image's content or function. It serves users and tools that can't see the image.
<img src="chart.png" alt="Sales grew 40% from Q1 to Q2" />
alt aloud, so a blind user knows what the image conveys. Without it, they hear the file name or just "image" — useless.alt text instead of a broken-image icon.alt to understand and index images (image SEO).<!-- ✅ describe the MEANING, not "image of..." -->
<img src="dog.jpg" alt="A golden retriever catching a frisbee" />
<!-- ✅ for functional images, describe the ACTION -->
<a href="/home"><img src="logo.png" alt="Acme home" /></a>
<!-- ✅ DECORATIVE images get an EMPTY alt so screen readers skip them -->
<img src="divider.png" alt="" />
The alt="" (empty, but present) is important: it tells screen readers "this is decorative, ignore it." Omitting alt entirely is different — then the reader may announce the filename.
alt is the single most important accessibility attribute for images and a legal requirement under accessibility standards (WCAG).
It makes content perceivable to non-sighted users, provides a fallback when images break, and helps SEO — describe what the image means in context, and use alt="" for purely decorative images.