
Alt Text Best Practices 2025: Complete Guide + AI-Powered Generator
Alt text (alternative text) is a text description of images that screen readers announce to blind and visually impaired users. With 61 million Americans with disabilities and WCAG 2.2 mandating alt text for all informative images, proper image accessibility is both a legal requirement and business necessity.
This comprehensive 2025 guide covers everything you need to know about alt text, including AI-powered generation, when to use empty alt, complex image descriptions, and platform-specific implementation.
What you'll learn:
- β When to use alt text vs. empty alt vs. ARIA labels
- β How to write effective alt text (with examples)
- β AI-powered alt text generation (vs. manual writing)
- β Platform-specific guides (WordPress, Shopify, HTML)
- β Testing alt text with screen readers
- β Common mistakes and how to avoid them
Table of Contents
- What is Alt Text?
- Why Alt Text Matters
- When to Use Alt Text
- How to Write Good Alt Text
- Alt Text vs. Empty Alt vs. ARIA Labels
- AI-Powered Alt Text Generation
- Platform-Specific Implementation
- Complex Images and Long Descriptions
- Testing Alt Text
- Common Alt Text Mistakes
- Free AI Alt Text Generator
What is Alt Text?
Alt text (alternative text, alt attribute, or alt tag) is HTML code that describes the content and function of an image. It appears in the alt attribute of the <img> tag:
<img src="golden-retriever-puppy.jpg" alt="Golden retriever puppy playing with tennis ball in grass">
Who uses alt text?
- Screen reader users (blind/visually impaired) - Alt text is read aloud
- Search engines - Alt text helps Google understand images
- Users with images disabled - Alt text displays when images don't load
- Users with slow connections - Alt text appears while images load
WCAG Requirements:
- WCAG 1.1.1 Non-text Content (Level A): All informative images must have text alternatives
- Failure to provide alt text = accessibility violation = potential lawsuit
Why Alt Text Matters
1. Legal Compliance
United States:
- 4,605 ADA website lawsuits filed in 2024
- Missing alt text = #1 most common accessibility violation (85% of sites)
- Average settlement: $25,000-$75,000
- Domino's Pizza v. Robles (2019): Website accessibility required
European Union:
- European Accessibility Act (EAA) now in force since June 28, 2025
- Missing alt text = non-compliance
- Penalties up to β¬100,000 or 4% of annual revenue
2. SEO Benefits
Google Image Search:
- Alt text is a ranking factor for image search
- Improves visibility in Google Images
- Helps Google understand page context
Example SEO impact:
- E-commerce site with 1,000 products
- Added descriptive alt text to all product images
- 32% increase in organic traffic from image search within 3 months
3. User Experience
Screen reader users:
- 26 million Americans have vision impairments
- Alt text enables shopping, research, entertainment
- Good alt text = better customer experience = higher conversion
All users:
- Alt text appears when images fail to load
- Helps users on slow connections
- Provides context when images are disabled
When to Use Alt Text
Decision Tree
Ask: "Does this image convey information or have a function?"
YES β Use descriptive alt text
- Product images (e-commerce)
- Informational graphics, charts, diagrams
- Logos that also serve as links
- Photos illustrating article content
- Icons with meaning (social media icons)
- Buttons created as images
- Maps, screenshots, infographics
NO β Use empty alt (alt="")
- Decorative images (flourishes, dividers, backgrounds)
- Images used purely for visual design
- Images where adjacent text already describes them
- Icons next to text labels (redundant)
How to Write Good Alt Text
The Golden Rules
1. Be Descriptive but Concise
- Describe what you see
- Keep under 125 characters (screen reader limit)
- Focus on important details
2. Don't Say "Image of" or "Picture of"
- Screen readers announce "Image" already
- Redundant and wastes characters
3. Describe the Content, Not the Medium
- β "Photo of a dog"
- β "Golden retriever puppy playing with tennis ball"
4. Include Context When Relevant
- Consider why the image is included
- Describe relevant details for understanding
5. Don't Include Filename or Technical Details
- β "IMG_1234.jpg"
- β "dog-photo-800x600.png"
Examples: Product Images
E-commerce product page:
<!-- BAD: Too vague -->
<img src="shirt.jpg" alt="Shirt">
<!-- BAD: Redundant -->
<img src="shirt.jpg" alt="Image of a shirt">
<!-- BAD: Technical details -->
<img src="shirt.jpg" alt="shirt-blue-medium.jpg">
<!-- GOOD: Descriptive, includes relevant details -->
<img src="shirt.jpg" alt="Men's blue cotton t-shirt, crew neck">
<!-- EVEN BETTER: Includes variation if multiple options -->
<img src="shirt.jpg" alt="Men's blue cotton t-shirt, crew neck, available in sizes S-XXL">
Why the last example is best:
- Identifies the product (t-shirt)
- Describes appearance (blue, cotton, crew neck)
- Specifies audience (men's)
- Includes availability info (sizes)
Examples: Informational Images
Blog post photo:
<!-- BAD -->
<img src="meeting.jpg" alt="Meeting">
<!-- GOOD -->
<img src="meeting.jpg" alt="Three colleagues discussing project at whiteboard">
<!-- EVEN BETTER: Contextual -->
<img src="meeting.jpg" alt="Software developers collaborating on system architecture diagram at whiteboard">
Icon with text label:
<!-- When icon appears NEXT TO text (redundant, use empty alt) -->
<a href="/cart">
<img src="cart-icon.svg" alt="">
Shopping Cart (3 items)
</a>
<!-- When icon appears WITHOUT text (use descriptive alt) -->
<a href="/cart">
<img src="cart-icon.svg" alt="Shopping cart (3 items)">
</a>
Examples: Functional Images
Logo that links to homepage:
<!-- GOOD: Describes function -->
<a href="/">
<img src="logo.png" alt="AllAccessible home">
</a>
<!-- ALSO GOOD: Company name + function -->
<a href="/">
<img src="logo.png" alt="AllAccessible - Return to homepage">
</a>
Social media share buttons:
<!-- GOOD: Describes action -->
<button>
<img src="twitter-icon.svg" alt="Share on Twitter">
</button>
<!-- ALSO GOOD: More specific -->
<button>
<img src="twitter-icon.svg" alt="Share this article on Twitter">
</button>
Search button:
<!-- GOOD -->
<button type="submit">
<img src="magnifying-glass.svg" alt="Search">
</button>
Alt Text vs. Empty Alt vs. ARIA Labels
When to Use Each
| Scenario | Solution | Example |
|---|---|---|
| Informative image | alt="description" | Product photos, charts, meaningful icons |
| Decorative image | alt="" | Borders, dividers, background patterns |
| Redundant image | alt="" | Icon next to text saying the same thing |
| Complex image | alt="summary" + long description | Charts, diagrams, infographics |
| CSS background image | Use ARIA or HTML text | Hero backgrounds with text overlay |
Empty Alt (alt="")
When to use:
- Decorative images that don't convey information
- Images where adjacent text already describes them
- Icons that are purely visual enhancements
Examples:
<!-- Decorative border image -->
<img src="decorative-border.png" alt="">
<!-- Icon next to text label (redundant) -->
<button>
<img src="download-icon.svg" alt="">
Download PDF
</button>
<!-- Decorative photo on marketing page -->
<section class="hero">
<img src="abstract-background.jpg" alt="">
<h1>Welcome to Our Service</h1>
</section>
Why empty alt, not removing alt entirely?
- Without
altattribute: Screen reader announces filename ("decorative-dash-border-dash-line.png") - With
alt="": Screen reader skips image entirely - Always include alt attribute, even if empty
ARIA Labels for Background Images
Problem: CSS background images don't have alt text
Solution: Use ARIA labels or visible text
<!-- CSS background image with ARIA label -->
<div class="hero-banner"
style="background-image: url('mountain-landscape.jpg')"
role="img"
aria-label="Mountain landscape at sunset with snow-capped peaks">
<h1>Explore the Outdoors</h1>
</div>
<!-- Better: Use visible caption -->
<figure>
<div class="hero-banner" style="background-image: url('mountain-landscape.jpg')"></div>
<figcaption class="visually-hidden">Mountain landscape at sunset with snow-capped peaks</figcaption>
</figure>
AI-Powered Alt Text Generation
Manual vs. AI Alt Text
Manual alt text writing:
- β Contextually accurate
- β Includes brand-specific details
- β Time-consuming (2-5 minutes per image)
- β Inconsistent quality
- β Not scalable for large sites
AI-powered alt text:
- β Fast (seconds per image)
- β Consistent format
- β Scalable (thousands of images)
- β Good baseline descriptions
- β May miss context
- β Requires human review for accuracy
How AI Alt Text Works
Modern agentic AI (like AllAccessible AI):
- Analyzes image pixels
- Identifies objects, people, text, scenes
- Generates natural-language descriptions tuned for accessibility
- Applies best practices (concise, descriptive, context-aware)
Example AI-generated alt text:
Input image: Photo of a woman using a laptop at a coffee shop
AI output: "Woman working on laptop at cafe table with coffee cup"
Human refinement: "Business professional using MacBook at outdoor cafe, coffee and notebook on table"
(Human adds context: business professional, MacBook brand, outdoor setting)
When to Use AI Alt Text
β Good use cases:
- Large product catalogs (e-commerce)
- Stock photos on blog posts
- User-generated content (social media, reviews)
- Legacy content with missing alt text
- Initial baseline for human review
β Not recommended:
- Critical images (homepage hero, key products)
- Images requiring brand-specific language
- Images with embedded text (use OCR + manual)
- Charts and diagrams (complex images need manual)
AI Alt Text Best Practices
1. Always Review AI Output
- AI provides baseline, humans add context
- Check for accuracy and relevance
- Add brand-specific terminology
2. Combine AI + Human Workflow
1. AI generates alt text for all images
2. Humans review high-priority images (homepage, top products)
3. Accept AI suggestions for low-priority images (blog archives)
3. Train AI on Your Content
- Provide examples of good alt text for your products
- Use brand style guide terminology
- Create templates for common image types
Platform-Specific Implementation
WordPress
Method 1: Media Library (Recommended)
- Go to Media β Library
- Click on image
- Enter alt text in Alternative Text field
- Click Update
Method 2: While Adding to Post
- Insert image into post/page
- Click image β Click pencil icon (Edit)
- Enter alt text in Alternative Text field
- Click Update
Code (if editing theme files):
<?php
// Get featured image with alt text
if (has_post_thumbnail()) {
echo get_the_post_thumbnail(
get_the_ID(),
'large',
array('alt' => get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true))
);
}
?>
WordPress Plugins for AI Alt Text:
- AllAccessible for WordPress - AI-powered alt text generation
- ImageSEO - Automatic alt text with AI
- WP Accessibility - Accessibility checks including alt text
Shopify
Method 1: Product Admin
- Go to Products β Select product
- Click on image
- Click Add alt text
- Enter description
- Click Save
Method 2: Theme Code (Liquid)
{%- comment -%}
Product image with alt text
{%- endcomment -%}
{% if product.featured_image %}
<img
src="{{ product.featured_image | image_url: width: 800 }}"
alt="{{ product.featured_image.alt | default: product.title | escape }}"
width="800"
height="800"
/>
{% endif %}
{%- comment -%}
Fallback: If merchant didn't add alt text, use product title
{%- endcomment -%}
Shopify Apps for Alt Text:
- AllAccessible for Shopify - Automated alt text for products
- SEO Image Optimizer - Bulk alt text editing
HTML (Hand-Coded Sites)
Basic image:
<img src="/images/product-laptop.jpg"
alt="Silver 15-inch laptop, open with blank screen"
width="800"
height="600">
Responsive images with srcset:
<img
srcset="
/images/product-small.jpg 400w,
/images/product-medium.jpg 800w,
/images/product-large.jpg 1200w
"
sizes="(max-width: 600px) 400px,
(max-width: 1000px) 800px,
1200px"
src="/images/product-medium.jpg"
alt="Wireless bluetooth headphones, black with silver accents"
width="800"
height="600">
Picture element with multiple sources:
<picture>
<source media="(min-width: 800px)" srcset="/images/hero-desktop.jpg">
<source media="(min-width: 400px)" srcset="/images/hero-tablet.jpg">
<img src="/images/hero-mobile.jpg"
alt="Team collaboration in modern office, people working together at whiteboard"
width="400"
height="300">
</picture>
Complex Images and Long Descriptions
Complex images (charts, diagrams, infographics) need more than 125 characters.
Solution: Short alt + long description
Method 1: Adjacent Text
<figure>
<img src="sales-chart-2024.png"
alt="Bar chart showing quarterly sales growth in 2024">
<figcaption>
<details>
<summary>Chart description</summary>
<p>
Bar chart showing quarterly sales for 2024. Q1: $2.5M, Q2: $3.1M (24% increase),
Q3: $3.8M (23% increase), Q4: $4.2M (11% increase). Overall annual growth: 68%.
</p>
</details>
</figcaption>
</figure>
Method 2: aria-describedby
<img src="complex-diagram.png"
alt="System architecture diagram"
aria-describedby="diagram-description">
<div id="diagram-description">
<p>
The diagram shows a three-tier architecture with a React frontend,
Node.js API server, and PostgreSQL database. The frontend communicates
with the API via HTTPS on port 443. The API connects to the database
on port 5432. A Redis cache sits between the API and database for
performance optimization.
</p>
</div>
Method 3: Link to Full Description
<figure>
<img src="infographic.png"
alt="Accessibility statistics infographic - see full description below">
<figcaption>
<a href="#infographic-description">Full description of infographic</a>
</figcaption>
</figure>
<div id="infographic-description">
<h2>Accessibility Statistics Infographic Description</h2>
<p>The infographic contains the following statistics:</p>
<ul>
<li>61 million Americans have a disability (26% of adults)</li>
<li>$13 trillion global disability market</li>
<li>4,605 ADA lawsuits filed in 2024</li>
<li>27% higher conversion rates on accessible sites</li>
</ul>
</div>
Testing Alt Text
Automated Testing
axe DevTools (Browser Extension):
- Install from Chrome/Firefox extension store
- Open page with images
- Click "Scan ALL of my page"
- Review "Images must have alternate text" violations
WAVE (WebAIM):
- Visit https://wave.webaim.org/
- Enter your URL
- Review red icons for missing alt text
- Review yellow alerts for suspicious alt text (filenames, "image of", etc.)
Manual Testing with Screen Readers
NVDA (Windows - Free):
- Download from https://www.nvaccess.org/
- Install and launch NVDA
- Navigate to page with images
- Press G to jump to next graphic
- Listen to alt text announcement
What you should hear:
- β "Graphic, Golden retriever puppy playing with tennis ball in grass"
- β "Graphic, IMG underscore 1234 dot JPG" (filename = missing alt text)
- β "Graphic" (no description = missing alt text)
VoiceOver (Mac - Free):
- Press Cmd+F5 to enable VoiceOver
- Navigate to page
- Press VO+Right Arrow to move through elements
- Listen to image descriptions
Browser Developer Tools
Chrome DevTools:
- Right-click image β Inspect
- Look for
altattribute in HTML - Accessibility pane shows computed name
Firefox Accessibility Inspector:
- Right-click image β Inspect Element
- Click Accessibility tab
- View "Name" property (should show alt text)
Common Alt Text Mistakes
1. Using Filenames
<!-- BAD: Filename as alt text -->
<img src="IMG_1234.jpg" alt="IMG_1234.jpg">
<!-- GOOD: Descriptive alt text -->
<img src="IMG_1234.jpg" alt="Close-up of fresh strawberries in wooden basket">
2. Starting with "Image of" or "Picture of"
<!-- BAD: Redundant -->
<img src="dog.jpg" alt="Image of a dog">
<!-- GOOD: Concise -->
<img src="dog.jpg" alt="Golden retriever puppy sitting in grass">
3. Alt Text Too Long
<!-- BAD: Over 125 characters -->
<img src="team.jpg" alt="Our amazing team of software engineers, designers, product managers, and customer success specialists working together in our beautiful modern office space with lots of natural light and ergonomic furniture to create the best possible products for our customers">
<!-- GOOD: Concise, under 125 characters -->
<img src="team.jpg" alt="Software development team collaborating in modern office">
4. Missing Alt for Decorative Images
<!-- BAD: Descriptive alt for decorative image -->
<img src="decorative-line.png" alt="Blue horizontal line">
<!-- GOOD: Empty alt -->
<img src="decorative-line.png" alt="">
5. Duplicate Alt Text
<!-- BAD: Alt text same as adjacent heading -->
<h1>Contact Us</h1>
<img src="contact-icon.svg" alt="Contact Us">
<!-- GOOD: Empty alt (redundant with heading) -->
<h1>Contact Us</h1>
<img src="contact-icon.svg" alt="">
Free AI Alt Text Generator
How It Works
AllAccessible's AI Alt Text Generator uses AllAccessible AI vision models to analyze images and generate WCAG-compliant alt text in seconds.
Features:
- β Upload any image (JPG, PNG, WebP)
- β AI analyzes content and context
- β Generates concise, descriptive alt text
- β Provides multiple variations to choose from
- β Checks alt text length (<125 characters)
- β Free to use (no signup required)
Try it now: AllAccessible AI Alt Text Generator β
Conclusion
Alt text is essential for accessibility, SEO, and user experience. With AI-powered generation tools, adding alt text is faster than everβbut human review ensures accuracy and context.
Key Takeaways:
- β Use descriptive alt text for informative images
- β
Use empty alt (
alt="") for decorative images - β Keep alt text under 125 characters
- β Don't say "image of" or use filenames
- β Use AI to accelerate, but always review
- β Test with screen readers (NVDA, VoiceOver)
- β Platform-specific implementation (WordPress, Shopify, HTML)
Next Steps:
- Audit your site with axe DevTools or WAVE
- Identify images missing alt text
- Use AI generator for baseline descriptions
- Review and refine AI-generated alt text
- Test with screen reader to verify
Need help? AllAccessible provides automated alt text generation with AI and real-time accessibility monitoring. Start free trial β
Published: November 13, 2025 Last Updated: November 13, 2025 Reading Time: 20 minutes
About AllAccessible: We provide AI-powered accessibility solutions including automated alt text generation, real-time WCAG monitoring, and comprehensive remediation tools. Learn more at allaccessible.org.