Alt text, the alt attribute of an image, is one of those tasks everyone knows they should do and almost nobody does well. Some people leave it empty, others stuff it with keywords, and others type “image” and move on to the next one. In this article you will see what it is really for, how to write it in under a minute, and a table of good and bad examples that you can use as a template.
What alt text is for
It serves three audiences at once. The first, and the most important, is people who are blind or have low vision and browse with a screen reader: the reader reads them the alt text in place of the image. The second is any visitor when the image fails to load, because the browser shows the text in its place. The third is Google, which uses the alt text, together with the text around the image, to understand what it shows and in which searches it makes sense to display it.
If you think about the first audience, you will get it right for the other two almost every time. The useful question is: if someone could not see this image, what would they need to know so they don’t miss anything important on the page?
Five rules are enough
- Describe what you see and why it is there. A photo of a coffee on a recipe page is not the same as one on a coffee shop’s menu.
- Keep it short. One sentence is usually enough; as a practical guideline, the usual recommendation is to stay under about 125 characters.
- Don’t start with “image of” or “photo of.” The screen reader already announces that it is an image.
- Don’t repeat keywords. If the natural description includes the keyword, great; if you have to force it in, it doesn’t belong.
- If the image is decorative, leave the alt empty. Write alt="": that way the screen reader skips it. Don’t remove the attribute, because then some readers read out the file name instead.
Ten examples, good and bad
| Image | Weak alt | Alt that works |
|---|---|---|
| Photo of a coffee on a coffee shop’s website | coffee | Latte with leaf art in a white cup on our wooden counter |
| Portrait of the owner of a law firm | photo | Lucía, attorney and founder of the firm, at her desk |
| Sales chart | chart | Bar chart: sales rise from 120 to 310 orders between January and June |
| Logo that links to the homepage | logo | ImagenesXIA home |
| Magnifying glass icon in a search box | magnifying glass | Search |
| Product photo: sneaker | sneaker sneakers buy sneakers cheap sneakers | Navy blue running shoe with white sole, side view |
| Decorative background image | pretty blue background | (empty: alt="") |
| Screenshot of a step | screenshot | Settings menu with the “Backups” option selected |
| Infographic with a lot of text | infographic | One-sentence summary of the infographic; the full content goes in the page text |
| Photo of a dish at a restaurant | IMG_0231 | Brothy lobster rice served in a clay pot |
Look at the chart and the infographic: when an image contains data, the alt text cannot say it all. Give the conclusion in the alt and put the full data in the page text or in a table. That way everyone can use it, Google included.
The cases that raise the most questions
Images that are links. If the image is the only thing inside a link, the alt should say where it leads, not what it shows. The logo that takes you to the homepage is not “logo on white background”; it is “Home of” followed by the brand name.
The same image on several pages. The alt depends on the context, so it can change from one page to another. The same portrait can be “Customer service team” on the contact page and “María, customer service manager” on the team page.
Images made with artificial intelligence. The alt describes what you see, just as it would for a photo. The fact that the image was made with AI is stated in the credit or in the file’s metadata, not in the alt text.
How to check the ones on your website in ten minutes
Open each important page, right-click each image, and choose “Inspect”: you will see the alt attribute. If you prefer something faster, the accessibility tools built into browsers and audits such as Lighthouse will flag images without alt text. Start with the homepage and the pages that get the most visits, and don’t forget the images on buttons: they are the ones that fail most often and the ones that get in the way most for people browsing with a screen reader.
In short
Good alt text is a sentence that describes what you see and why it is there, with no filler or forced keywords, and it is left empty when the image is purely decorative. Doing it well takes a minute per image and improves accessibility, the experience when something fails, and the way Google understands your page, all at the same time. If you want to keep going, our guide to images and SEO covers the other signals that count.
A complete case: a bicycle shop
To see how a page changes, let’s take the product page for a city bike in an online store. It has four images: the bike in profile, a close-up of the gear shifter, the bike on a trail, and the manufacturer’s logo in the footer.
| Image | Before | After |
|---|---|---|
| Bike in profile | “bike” | “Green city bike with front basket and fenders, side view” |
| Gear shifter close-up | “image2” | “Close-up of the seven-speed shifter on the handlebar” |
| On a trail | “bike bikes buy bike cheap bike” | “The same bike parked beside a dirt trail among olive trees” |
| Logo in the footer | “logo” | Empty alternative text, because it is decorative and the brand is already named in the text |
The text in the “After” column isn’t longer on a whim: it is what a person who can’t see the image needs in order to understand what they are buying. And it is exactly what Google needs to know what each image shows.
What the accessibility standard says
The international web accessibility guidelines, known as WCAG, require all non-text content to have a text alternative that serves the same purpose. In Spain, the regulation that applies to public-sector websites refers to those guidelines, and the European Accessibility Act has extended obligations to many online stores and private services since June 2025. Even if your business is not required to comply, writing good alternative text is the cheapest way to honor the spirit of those rules.
Mistakes that keep showing up
- Starting with “image of” or “photo of”: the screen reader already announces that it is an image.
- Copying the same alternative text onto every image on a page.
- Describing the style and forgetting the content: “lovely photo in warm tones” doesn’t say what can be seen.
- Leaving the default alternative text added by the content management system, which is usually the file name.
Questions people ask us
How many characters should it have?
There is no official limit. One or two sentences are usually enough; if you need more, the information probably belongs in the text of the page.
What about the image title?
The title attribute doesn’t replace alternative text, and many screen readers don’t read it. If you want to add visible information, use a caption.
Do I have to write it in each language?
Yes. If your website has several languages, the alternative text should be in the language of each page.
