Alt text describes an image for everyone who cannot see it: someone using a screen reader, a visitor whose image does not load, and a search engine. In its image guidelines, Google calls the alt attribute the most important attribute for information about an image.
Google uses alt text together with computer vision and the page content to understand what an image shows. If the image is a link, the alt text works as anchor text.
Example
<!-- Missing -->
<img src="veluwe-boot.jpg">
<!-- Descriptive -->
<img src="veluwe-boot.jpg" alt="Green Veluwe walking boot, side view with treaded sole">
<!-- Decorative: empty alt -->
<img src="wave-line.svg" alt="">When should alt text stay empty?
In its alt decision tree, the W3C recommends an empty alt for purely decorative images and for images that repeat text already next to them. A screen reader then skips the image. If an image sits inside a link or button, describe where the link goes or what the button does.
Common mistake
A string of keywords as alt text. Google writes that this creates a poor user experience and may cause your site to be seen as spam. Describe what is in the image, in an ordinary sentence.
Alt text is also part of accessibility under WCAG. More in Product pages for Google and AI assistants.