How to write alt text that helps both people and AI
What the rules say about alt text, when an image should have it and when it shouldn't, and why good alt text can't be written once and for all.
Alt text is a short text that describes an image. Most people never see it, but it does a lot. It is read aloud to people who use screen readers, it is shown when an image doesn't load, and it is often the only thing a search engine or AI agent understands about the image.
Even so, alt text is one of the things most often done wrong on the web. Sometimes it is missing altogether. Sometimes it sits on images that are pure decoration, and sometimes it describes the image without saying anything about why it is there. Here we go through what the rules actually say, when an image should have alt text and when it shouldn't, and why good alt text can't be written once and for all.
What do the rules say?
The foundation is WCAG, the Web Content Accessibility Guidelines developed by W3C. The very first success criterion, 1.1.1 Non-text Content, says that all content that isn't text must have a text alternative that serves the same purpose. The criterion is at the basic level A, so it is part of every requirement built on WCAG.
WCAG is not a law in itself. But EU legislation refers to the European standard EN 301 549, which is based on WCAG. Two EU directives set the requirements, and each country turns them into national law. In Sweden it looks like this.
- The Web Accessibility Directive covers websites and apps in the public sector. In Sweden it is the Act on accessibility to digital public services, which also covers privately run schools and care services funded with public money. The Agency for Digital Government supervises it.
- The European Accessibility Act has applied since 28 June 2025 and covers e-commerce and banking services, among other things. In Sweden it is the Act on the accessibility of certain products and services, and the Swedish Post and Telecom Authority supervises e-commerce, among other things.
None of the rules say exactly what the alt text should say. They say the text alternative should serve the same purpose as the image. And the purpose of an image depends on where it is used.
When should an image have alt text?
Ask yourself what the visitor would miss if the image disappeared. The answer is what the alt text should contain.
Images that tell you something. A photo in a news story, a product image or an illustration that explains something. Describe what the image adds here, briefly and concretely.
Images that are links or buttons. Here the alt text should say where the link goes or what the button does, not what the image looks like. A logo that links to the home page can have the alt text "Strife, home page". A magnifying glass on a search button should be called "Search".
Images with text in them. If an image contains a price, a date or a heading, the same text should be in the alt text. Otherwise the information doesn't exist for anyone who can't see the image, and not for an AI agent either.
Charts and other complex images. Write a short alt text that says what the image shows and what the conclusion is. Put the details in the text next to it or in a table, where everyone can read them. A chart showing how a website ages could have the alt text "Chart from launch to year five. Quality falls while the number of pages grows, until it is time for the next web project."
When should an image not have alt text?
Some images the screen reader should skip. Those images should have empty alt text, an alt attribute with nothing in it.
Decoration. Patterns, shapes and images that only set a mood and add no information.
Images that repeat the text next to them. An icon next to the word "Print", or a product image on a card where the product name is already written underneath. If the image also had alt text, the same thing would be read out twice.
It is important to tell the difference between empty alt text and missing alt text. If it is missing altogether, many screen readers read out the file name instead, and the visitor hears something like "IMG underscore 4821 dot jpg". So the alt attribute should always be there, even when it is empty. And don't write "decorative image" or "image" in it. That is exactly what the visitor should be spared from hearing.
Short and concrete
One or two sentences is usually enough. Don't start with "Image of" or "Photo of", because the screen reader already says it is an image. Avoid repeating the caption, and put what matters first.
Before "Image of woman at computer in office"
After "A woman smiles as she reads something on her laptop, with her notebook open beside her"
Why alt text doesn't belong in the image library
It sounds practical. Write the alt text once when the image is uploaded to the image library, and it follows the image everywhere it is used. Many digital asset management systems, known as DAMs, work that way. The problem is that alt text doesn't describe a file. It describes what the image means in a particular place.
Take the illustration of a conference below. We made it with AI for this post. A speaker stands on stage in front of a large screen, and the room is full.

The illustration was made with AI. The people and the room are not real.
The same image can be used in four places, and each time a different part of it is what matters.
Behind a heading on the home page. The image sets the mood and the heading carries the message. Here the alt text should be empty.
In an article about the programme. The image is cropped to the speaker. The alt text becomes "A speaker talks about AI traffic and the agentic web at a conference".

In an article about AI traffic. The crop shows only the screen. Now the text is the whole point, so it belongs in the alt text. The slide is in Swedish, so on an English page the alt text gives its meaning in English, "Half of the visitors are not human".

On a page about upcoming events. The crop shows the audience. The alt text becomes "A packed room listens to a talk".

One file, four different alt texts, and all four are right where they are.
Cropping can change the subject
The crops also show how much cropping can change. In the original the speaker is a small figure on the left, the screen takes up a large part of the image and the audience fills the rest. Crop in on the speaker and the image is about her, and the audience is gone. Crop in on the screen and the text becomes the subject, so the text is what belongs in the alt text. Each crop is in practice a new image with new content, and the alt text that belonged to the original no longer fits.
Alt text that is stuck to the file knows nothing about where the image is shown or how it is cropped. So it ends up either so general that it says nothing, or wrong in many of the places where the image is used.
The image library still has an important job. A good description of what the image shows makes it easy to find, and can be a good starting point when you write the alt text. But the alt text itself is written where the image is used.
How it works in Strife
In Strife you write the alt text in the image field on the page, where you can see the context and how the image is cropped. The same image in the media library can have different alt text on different pages, just as it should.
In Strife an image can have its own crop for each screen, for example 16:9 on a computer and 4:3 on a phone. With the auto setting you don't have to crop them yourself. AI analyses the image, finds what is most interesting in it and frames each format around the subject. All the crops start from the same subject and are shown in the same place on the page, so one alt text is enough for all of them. If you crop a format yourself so that it shows something else, read the alt text again and check that it fits every crop. You can read how it works in One image, every screen. How the subject ends up in the right place every time.
Let AI do the groundwork
Writing alt text for hundreds of images that are already online is a job that rarely gets done. That is where AI helps the most.
Strife's AI suggests alt text the way we have described here. It sees what the image shows, and it also reads the page where the image appears. Based on the context it decides whether the image is pure decoration or has a purpose, and if so which one. If the image is decoration, it suggests empty alt text. If it has a purpose, it suggests alt text that describes what the image adds right there. The same image can get different suggestions on different pages, just as it should.
You can also ask Ask Strife, the chat in Strife, for suggested alt text, for example for every image that doesn't have any. You read the suggestions, change them if you like and save. Strife's built-in AI also works continuously to improve the content on your website and suggest what to do next.
If you work in an AI assistant such as Claude, ChatGPT or Copilot, you can also ask it to find every image on your website without alt text and suggest some. You could write, for example, "Find the blog posts that have images without alt text and suggest alt text for each image. Add them once I've checked."
Read about working with Strife in your AI assistant
Summary
- Every image should have an alt attribute.
- An image that tells you something gets alt text describing what the image adds right there.
- An image that is a link or a button says where it goes or what it does.
- Text in an image also goes in the alt text.
- Decoration and images that repeat the text next to them get empty alt text.
- Alt text is written where the image is used, not in the image library.