Image Alt Text
What the Alt Attribute Does
Image alt text is a short description of an image, stored in the alt attribute of an image element. It is displayed when the picture cannot load and is read aloud by screen readers, which lets people who cannot see the image understand it. Search engines also read it to understand what the image shows.
A description such as alt="Two blue mugs on a wooden table" is far more useful than a file name such as IMG_4821, or no attribute at all.
How Alt Text Supports Image Search
Search engines use images to understand a page and to produce results in image search. Alt text supplies a text description that complements the images and the surrounding words. A product photo with alt text that names the product helps both people and search engines match the image to a query.
Alt text should describe what matters in the image in the context of the page. It does not need to list every detail, and it should not repeat keywords for their own sake. A chart, for example, should be described by what it shows rather than only as “chart”.
Image URLs can also be named in structured data. That is a separate mechanism and does not replace the alt attribute.
Alt Text, Title Attributes and File Names
Three things are often confused:
- Alt text is the description used when an image cannot be shown and by screen readers.
- The title attribute produces a tooltip when a visitor hovers over the image. It does not replace alt text and is not read consistently by assistive technology. It is also different from the title tag of a page.
- The file name may offer a small hint, such as
hosting-diagram.png, but it is not a description.
Decorative images, such as a background pattern or a divider line, should have an empty alt attribute, written as alt="", so that screen readers skip them.
A Diagram in a Backup Guide
A guide about server backups includes a diagram showing how data moves between a server and a separate storage location. The original alt text read “image1”, which tells a screen reader user and a search engine nothing. The improved version describes the diagram: a server sends copies of its files to a separate storage location every night.
The surrounding paragraph then explains the same process in words, so the diagram supports the text rather than standing alone.
Frequently asked questions
Does alt text improve rankings directly?
Alt text is not a strong ranking factor on its own. Its main value is in helping search engines understand images, match them to image search queries and make the page accessible. Images that are relevant and placed near related text have the greatest effect.
How long should alt text be?
Alt text should be short, usually a phrase or a single sentence. Screen readers read the whole value, so very long descriptions become tiring. If an image carries detailed information, such as a complex chart, the same information should also appear in the page text or in a longer description nearby.