The short answer
#Write the alt attribute as the text you would use if the image could not be shown: short, specific and about why the image is on the page. If the image is purely decorative, keep the attribute but leave it empty, so screen readers skip it.
_10<!-- Informative image -->_10<img src="/team.jpg" alt="The five-person support team standing outside the Leeds office">_10_10<!-- Decorative image -->_10<img src="/swirl.svg" alt="">
Why it happens
#Screen readers read the alt text out in place of the image. Browsers also show it when the image fails to load, and search engines use it to understand the picture. If the attribute is missing entirely, many screen readers fall back to reading the file name, so users hear something like "IMG underscore 4032 dot JPG".
There is a real difference between a missing alt and an empty one. A missing alt says "this image has meaning, but nobody described it". An empty alt="" says "this image adds nothing, skip it". Both are deliberate choices, and getting them the wrong way round causes most alt text problems.
How to fix it
#Describe what matters in context
Ask what the image adds to the content around it, then write that. The same photo might need different text on different pages.
_10<!-- On a recipe page -->_10<img src="/bread.jpg" alt="Sourdough loaf with a deep golden crust and an open, airy crumb">_10_10<!-- On a bakery's opening hours page -->_10<img src="/bread.jpg" alt="Fresh bread on the counter at our Market Street shop">
Keep it to a sentence or so. Do not start with "Image of" or "Picture of", because the screen reader already announces it as an image. Do mention it if the type matters, such as "Screenshot of" or "Painting of".
Use an empty alt for decorative images
Borders, background textures, flourishes and icons next to text that already says the same thing are decorative. Give them alt="". Even better, if an image is only decoration, consider moving it to CSS with background-image.
_10<button>_10 <img src="/icons/trash.svg" alt="">_10 Delete_10</button>
The button text already says "Delete", so the icon would only repeat it.
Describe the action for linked or button images
When an image is the only content of a link or button, its alt text becomes the name of that control. Describe where it goes or what it does, not what it looks like.
_10<a href="/">_10 <img src="/logo.svg" alt="Danny Engineering home">_10</a>
Repeat the words in images of text
If an image contains text, such as a quote graphic or a banner, the alt text should contain the same words.
Give complex images a longer description
Charts, diagrams and maps need more than one line. Use short alt text to say what the image is, then put the detail in visible text nearby, for example in a figcaption or a data table.
_10<figure>_10 <img src="/sales-chart.png" alt="Bar chart of monthly sales for 2026, described below">_10 <figcaption>_10 Sales rose steadily from 1,200 in January to 3,400 in October, then dipped in November._10 </figcaption>_10</figure>
Common pitfalls
#- Leaving
altoff completely. Usealt=""for decoration rather than omitting it. - Filling it with keywords for SEO. It is read aloud, so stuffing makes the page worse for real people.
- Using an empty
alton an image that is the only thing inside a link, which leaves the link with no name. - Copying the caption word for word into
alt, so screen reader users hear it twice. - Relying on the
titleattribute instead. It is not a reliable substitute and many users never see or hear it. - Letting a CMS fill
altwith the file name by default.
Related reading
#HTMLquick question
Was this resource helpful?