How to Write Alt Text: Choose the Right Description
In this article
This guide explains how to write effective alt text for images, helping you choose descriptions that are both accessible and useful. You'll learn what to consider for different image types, common pitfalls to avoid, and practical tips for crafting concise, meaningful alternatives.
What You'll Need
- The image(s) you need to describe
- Context about where the image will appear (web page, social media, document)
- Basic understanding of the image's purpose (decorative, informative, functional)
Step-by-Step
- Determine the image's function. Ask: Why is this image here? Does it convey information, support the text, or is it purely decorative? The function dictates the alt text. Informative images need descriptive text; decorative images can have empty alt text (alt="").
- Describe the essential content. Focus on what the image shows that matters to the context. For a chart, describe the trend or key data point. For a photo, describe the subject and action. Avoid describing every minor detail; include only what a sighted user would notice and what is relevant.
- Keep it concise. Aim for a short phrase or sentence. Most screen readers cut off alt text at around 125 characters, so put the most important information first. If a longer description is needed, consider using a caption or a separate text description.
- Use keywords naturally. Include relevant keywords for SEO, but only if they fit naturally. Do not stuff keywords; alt text should read like a human description, not a list of search terms.
- Consider the surrounding text. If the image is next to a paragraph that already says the same thing, your alt text can be shorter. Avoid repeating what's already written. For example, if a caption says "Sales increased in Q3," the alt text can be "Line graph showing upward trend."
- Handle complex images specially. For charts, graphs, or diagrams, summarize the main takeaway in the alt text. For a full data table, provide the table as text elsewhere. For infographics, consider providing a text version of all key points.
- Decide on decorative images. If an image is purely decorative (e.g., a border, a spacer, a stock photo that adds no information), use empty alt text (alt="") so screen readers skip it. Do not use alt="spacer" or similar.
- Test your alt text. Read it aloud. Does it make sense without seeing the image? Would you understand the image's content and purpose? If not, revise.
Common Mistakes
- Over-describing: Listing every color, object, and detail. Alt text should be concise, not a novel.
- Under-describing: Using vague terms like "image" or "photo" without any content.
- Repeating the caption: If the caption already explains the image, alt text that duplicates it is redundant.
- Ignoring context: Describing an image the same way regardless of where it appears. The alt text should adapt to the surrounding content.
- Using "image of" or "picture of": Screen readers already announce that it's an image, so starting with "Image of" is redundant.
- Forgetting empty alt for decorative images: Leaving decorative images without alt attribute at all can cause screen readers to read the file name.
Tips
- Be specific but brief: "Golden retriever puppy chewing a red toy" is better than "Dog playing."
- Include text within images: If the image contains important text (like a sign or a screenshot), include that text in the alt text.
- Use proper punctuation: This helps screen readers pause correctly.
- For logos: Use the company name as the alt text, not a description of the logo design.
- For buttons and links: Use the action or destination as the alt text, e.g., "Search" or "Download PDF."
- For product images: Include the product name and key features, like "Blue ceramic mug with handle."
Troubleshooting
If you're unsure whether an image is decorative: Ask yourself: Would removing this image change the understanding of the page? If no, it's decorative. If yes, it needs descriptive alt text.
If the image is very complex (e.g., a detailed map): Provide a short summary in the alt text and link to a longer text description elsewhere on the page.
If you're writing alt text for a social media post: The platform may have its own character limits. Keep it short and put the key information first.
If you're unsure about the right level of detail: Err on the side of including the most important information, but avoid unnecessary details. When in doubt, ask a colleague who uses a screen reader for feedback.
Frequently Asked Questions
Do I need alt text for every image?
No. Decorative images that add no information can have empty alt text (alt=""). However, informative images, functional images (like buttons), and images with text should always have descriptive alt text.
How long should alt text be?
Ideally, under 125 characters. If you need more, put the essential info first and consider providing a longer description in the page content or via a link.
Should I use keywords in alt text for SEO?
Yes, but only if they fit naturally. Alt text is primarily for accessibility, but it also helps search engines understand the image. Avoid keyword stuffing.
What is the difference between alt text and a caption?
Alt text is read by screen readers and describes the image for those who can't see it. A caption is visible to everyone and often provides context or credits. They serve different purposes and can coexist.
Can I use the same alt text for the same image on different pages?
It depends on the context. If the image is used in a different context, the alt text should be adjusted to reflect what's relevant in that context.
What if I have a complex chart or graph?
Provide a brief summary of the main takeaway in the alt text. For full data, include a data table or a text list of key points elsewhere on the page.