What is Alt Text?
Alt text (alternative text) - also known as "alt description" or "alt attribute" - is the written description of images on HTML pages. Its primary purpose is to improve accessibility for people who can’t see images.
You’ll often hear people referring to it as "alt tag," but that’s technically incorrect. Alt text is an attribute contained within the HTML tag.
How Alt Text is Implemented
The alt attribute starts with alt=
followed by the alt text in quotation marks. It typically looks like this:
<img src="image.jpg" alt="Image alt text" title="Image Title"/>
Why is Alt Text Important?
Accessibility
Adding alt text to images is primarily about improving web accessibility. Millions of visually impaired users rely on screen readers to consume online content. For them, having a text equivalent to the visually displayed information is crucial. Without alt text, screen readers cannot convey the content of the image, which harms the user experience.
SEO Benefits
Alt text also plays a role in SEO. While alt attributes are not visible to users, they can be read by search engines and screen readers. The text helps search engines understand the content of the image. This adds semantic meaning to the image, improving the topical relevance of the page in Google's eyes and potentially helping it rank higher.
Furthermore, alt text can improve your chances of ranking in Google Images, providing an additional source of traffic for your website. When images are used as links, the alt text serves as anchor text, helping Google understand the linked page's content.
Best Practices for Alt Text
Adding alt text to images is an easy way to make your pages more accessible and support your SEO efforts. Here are some best practices to keep in mind:
1. Audit Your Website for Missing Alt Texts
Start by checking for missing alt texts. Use an online tool capable of crawling your site to find images with missing or empty alt texts. Tools like Google Search Console and various SEO audit tools can help with this task.
Not all images need alt text. Decorative images can be left without it, as they don't provide meaningful content and can be ignored by screen readers. Focus on your most visited pages that drive a lot of organic traffic.
2. Avoid Keyword Stuffing
While alt text can include relevant keywords to improve SEO, it's crucial to use informative and valuable text that aligns with the page's content. Avoid keyword stuffing, as this practice is discouraged by Google and can be seen as unethical and ineffective.
Use keywords sparingly and only where they naturally fit within the description.
3. Keep It Under 100 Characters
Alt text typically consists of a single word or a short phrase. The Functionality Accessibility Evaluator suggests that alt texts should be no more than 100 characters long. This gives you enough room to optimize your alt text, but ensure you don’t write long-winded descriptions that could be cut off by screen reading tools.
Example
Here’s an example of a well-written alt text for an image of a golden retriever playing fetch in a park:
<img src="golden-retriever.jpg" alt="Golden retriever playing fetch in a sunny park" title="Golden Retriever"/>
By following these best practices, you can make your website more accessible to all users and support your overall SEO strategy.
For more information on web accessibility and SEO best practices, refer to authoritative sources such as the Web Content Accessibility Guidelines (WCAG) and Google's SEO Starter Guide.