SEO and GEO

Alt text

Alt text is a short text that describes an image or its function on a web page. For example, the text can describe the content of a product image or tell you where an image link leads. The alt text normally sits in the image's alt attribute in HTML.
→ All articles

What is alt text?

Alt text gives you access to the meaning an image otherwise conveys visually. A screen reader can read the text aloud, and the browser can display it if it can't load the image. You may also come across the terms alternative text, image description and the Danish term alt-tekst.

Good alt text depends on the context of the page. You don't necessarily need to describe every detail of the image. Instead, you need to identify the information or action the reader needs to understand. The same image can therefore need different descriptions on different pages.

How do you use alt text?

You attach the alt text to the image through the alt attribute in HTML. Start by asking yourself what the image contributes on that particular page. The answer helps you choose between a description of the content, a description of an action or an empty attribute.

For example, you can highlight a relevant feature of a product if that feature helps the reader understand the content. You normally don't need to start with the words “image of” or “photo of”, because screen readers often already announce that the content is an image.

You can write alt text for a product image like this:

<img src="kontorstol.jpg" alt="Black office chair with adjustable armrests">

The description highlights a feature of the chair without listing every visible detail. Always consider whether the colour and the armrests actually matter in the context of the page.

Why should you use alt text?

Alt text helps people who use a screen reader or can't see an image. You give them access to the information or function, so they don't have to guess what the image means. The text can also help other readers if the browser doesn't load the image.

Alt text is also part of image SEO. Google uses alt text, image analysis and the rest of the text on the page, among other things, to understand images. That gives the search engine a signal about the image's content, and it doesn't guarantee better rankings.

Write first and foremost for the person who needs the description. Repeated keywords can make the text less useful, and they don't give the reader a clear understanding of the image.

Which types of alt text can you use?

You can adapt the alt text to several types of images. The role of the image decides what you should write.

  • Informative images: You describe the essential information the image conveys.
  • Functional images: You describe the action or destination if the image works as a button or a link.
  • Decorative images: You use alt="" if the image adds no relevant information.
  • Images of text: You include the words the reader needs to understand.
  • Complex images: You write a short alt text and add a more detailed explanation in the page text.
  • Groups of images: You let the description cover the overall meaning if several images convey one piece of information.

A chart, for example, may need more than a short description of its subject. You can give the reader an overview in the alt text and explain the relevant data in the text around the chart.

How do you use alt text in practice?

Start by going through the images on the page and assessing their function one at a time. An icon that works as a link typically needs different text from an image that shows a product feature.

You can describe the destination when an image works as a link:

<a href="/kundeservice">
  <img src="kundeservice-ikon.svg" alt="Contact customer service">
</a>

Here, the alt text tells the reader what they can do, rather than only describing what the icon looks like. You can use the same principle when an image works as a button.

You can check your descriptions in a code review and test the page with a screen reader or an accessibility tool. Also compare the alt text with the text around the image, so you avoid unnecessary repetition.

What should you watch out for?

Keep the description short and start with the most important information. Make sure the text also fits the role of the image. A description of its appearance, for example, won't necessarily help the reader understand where an image link leads.

Use an empty alt attribute for purely decorative images rather than writing a description that adds nothing. On the other hand, include important text from an image if the reader needs the words to understand the content. An automated check can help you find gaps, and you still need to judge for yourself whether each description makes sense in context.

Ready to grow? Let’s talk

→ Book a chat