Alt text serves two purposes
Alt text — the alt attribute on an HTML img element — serves two distinct purposes that are often conflated. First: accessibility. Screen readers, used by people who are blind or have low vision, read alt text aloud when encountering an image. Second: SEO. Search engine crawlers cannot see images, so they read alt text to understand what an image contains and how it relates to the surrounding content. Good alt text serves both at once.
The way most people write alt text — skipping it, using generic phrases like "image" or "photo," or stuffing it with keywords — fails both. This is the practical guide.
The core principle: describe content and function
Alt text should describe what is in the image and, where relevant, what function it serves on the page. It should be specific enough that someone who cannot see the image understands what it contains.
Bad: alt="photo" — says nothing. Bad: alt="person smiling" — generic and useless. Bad: alt="HEIC converter free online tool best" — keyword stuffing that is useful to neither humans nor search engines. Good: alt="HEIC file being dropped onto the converter interface showing file size reduction from 4.2MB to 1.1MB" — specific, descriptive, contextual.
Decorative images: use empty alt text
Purely decorative images — backgrounds, dividers, abstract patterns — should have an empty alt attribute: alt="". This tells screen readers to skip the image entirely, which is correct since there is nothing meaningful to announce. This is different from omitting the attribute entirely — omitting it causes screen readers to read the file name, which is confusing.
Functional images: describe the action
Images that serve a function — buttons, link icons — should describe what clicking them does, not what they look like. A magnifying glass icon that triggers search should be alt="Search" not alt="magnifying glass icon." A right arrow that advances a slideshow should be alt="Next slide" not alt="right-pointing arrow."
Complex images: charts and diagrams
Charts convey information that cannot be fully described in short alt text. Best practice: brief description in alt, with full data available in the surrounding text or a linked table. For a revenue bar chart: alt="Bar chart showing monthly revenue Q1–Q4 2025, data in table below."
Length and keyword usage
Keep alt text under 125 characters — screen readers become difficult to follow at longer lengths. Include relevant keywords naturally where they genuinely describe the image. An image of someone using a word counter tool should naturally include "word counter" in the alt text if that is what the image shows. Do not force keywords into alt text for decorative or contextually unrelated images.
Testing your alt text
Simple test: read the alt text aloud and ask whether someone who cannot see the image now understands what it contains. Browser accessibility tools like Chrome's Lighthouse audit or the axe extension can identify images with missing or inadequate alt text across an entire page.