Image alt text (the alt attribute on <img> tags) serves two purposes: it provides a text description for screen readers used by visually impaired users, and it gives search engines context about image content for image search ranking and page relevance signals.
Alt Text Syntax
<img src="/images/red-running-shoes.jpg" alt="Red Nike Air Max running shoes on a white background" />
The alt attribute is placed directly on the <img> element. Every non-decorative image on your page must have an alt attribute with descriptive text.
Writing Effective Alt Text
Be Specific and Descriptive
Describe what the image actually shows, not what you wish it showed:
<!-- Bad: vague -->
<img alt="product" />
<!-- Bad: generic -->
<img alt="image of shoes" />
<!-- Good: specific -->
<img alt="Women's blue leather hiking boots with Vibram soles" />
Include Keywords Naturally
Alt text is a legitimate place to include target keywords, but only when the keyword accurately describes the image:
<!-- Good: keyword fits naturally -->
<img alt="Google Analytics 4 dashboard showing real-time user count" />
<!-- Bad: keyword stuffed -->
<img alt="analytics dashboard analytics tool best analytics platform free analytics" />
Keep It Concise
Screen readers announce alt text in full before moving to the next element. Alt text over 125 characters becomes tedious for assistive technology users. Aim for 5-15 words that capture the essential content.
Decorative Images
Images that serve purely visual purposes (borders, spacers, background textures) should have an empty alt attribute:
<img src="/images/decorative-divider.svg" alt="" />
An empty alt="" tells screen readers to skip the image entirely. This is different from omitting the alt attribute, which causes screen readers to announce the filename instead.
Image SEO Beyond Alt Text
File Names
Use descriptive, hyphen-separated file names:
red-nike-air-max-running-shoes.jpg (good)
IMG_4392.jpg (bad)
Google extracts keywords from image file names as a secondary signal.
Surrounding Context
Google considers the text near an image when determining its relevance. Place images adjacent to related content, and use captions when appropriate.
Structured Data
For product images, recipe photos, and other specific content types, implement structured data (Schema.org) to give search engines explicit metadata about the image's subject.
WCAG Accessibility Requirements
WCAG 2.1 Success Criterion 1.1.1 (Level A) requires that all non-text content has a text alternative that serves the equivalent purpose. This means:
- Informative images need alt text describing their content or function.
- Functional images (buttons, links) need alt text describing the action, not the image. A search icon that submits a form should have
alt="Search", notalt="magnifying glass". - Complex images (charts, graphs, diagrams) need both a brief alt text and a longer description, either in a
longdescattribute or adjacent text. - Images of text should have alt text containing the same text shown in the image.
Audit Process
- Crawl your site and export all images with their alt attributes. Screaming Frog's "Images" tab provides this.
- Flag missing alt attributes. These are WCAG violations and SEO gaps.
- Flag alt text that is just the filename (e.g.,
alt="IMG_4392.jpg"). These need rewriting. - Flag alt text over 125 characters for conciseness review.
- Spot-check decorative images to ensure they use
alt=""rather than descriptive text. - Prioritize high-traffic pages for manual review of alt text quality and keyword relevance.
Impact on Search
Google Images drives significant traffic for product, recipe, and visual content queries. Properly optimized alt text is the primary ranking factor for image search results. Sites that invest in descriptive, keyword-relevant alt text consistently outperform those relying on auto-generated or missing alt attributes.