Alt text is the description you put in an image's alt attribute so that people using screen readers know what the image shows, and search engines can understand it too. Accessibility is the primary reason it exists; image SEO is a real but secondary benefit. Write it as a short, specific description of the image in context, skip it (with alt="") for purely decorative graphics, and let relevant keywords appear only when they genuinely describe what is on screen. This guide covers how to write it well, when to leave it empty, how it works with filenames and sitemaps, and how to audit it across a whole site.
What alt text is and its dual role
The alt attribute is part of the HTML img element. In markup it looks like this:
<img src="pune-office.jpg" alt="Team working at the DeployFlare office in Pune">
The text serves two audiences at once.
Accessibility comes first. Screen readers read the alt value aloud so that a person who cannot see the image still gets the information it carries. It is also shown when an image fails to load, and it helps people on slow connections. Web accessibility guidelines, notably WCAG, treat text alternatives as a baseline requirement, which is why many companies are contractually or legally obligated to get this right.
Image SEO comes second. Google has stated that alt text helps it understand the subject of an image, which supports ranking in Google Images and adds topical context to the page. Because Google cannot reliably read the pixels of every image, the text you supply is one of its clearest signals about what the picture depicts.
The two goals almost never conflict. Text that clearly describes an image for a blind user is also the text that best informs a search engine. When people damage their SEO with alt text, it is usually because they optimized for the machine and forgot the person.
How to write descriptive, useful alt text
Good alt text answers a simple question: if the image vanished, what would a reader need to know? Describe the content and function of the image, not the fact that it is an image.
A few working rules:
- Be specific. "Graph" is useless; "Line graph showing organic traffic rising from 2,000 to 9,000 monthly visits over six months" is useful.
- Keep it concise. One sentence, roughly 5 to 15 words for most images. web.dev recommends describing the image the way you would to someone over the phone.
- Skip redundant phrases. Screen readers already announce that the element is an image, so avoid starting with "Image of" or "Picture of."
- Match context. The same photo of a shoe might be "Blue running shoe, side profile" on a product page and "Runner lacing up before a morning run in a Mumbai park" in a blog post. Context changes the right description.
- Do not end with a file extension or dump the filename. That is not a description.
Here are concrete before-and-after examples.
| Weak alt text | Better alt text | Why it improves |
|---|---|---|
alt="IMG_4021" |
alt="Founder presenting a rank-tracking dashboard on stage" |
Describes actual content instead of a camera filename |
alt="seo tool" |
alt="DeployFlare keyword research view showing 12 India-focused keywords" |
Specific and informative rather than a bare keyword |
alt="chart chart data analytics graph" |
alt="Bar chart comparing click-through rate across five title variants" |
Reads naturally; not keyword stuffing |
alt="" on a hero product photo |
alt="Close-up of the audit report highlighting three critical errors" |
Informative images should not be silent |
For functional images such as a logo that links home, or an icon that triggers an action, describe the function rather than the appearance. A magnifying-glass icon that runs a search should be alt="Search", not alt="magnifying glass". This is a core principle of on-page structure, closely tied to how you handle header tags for SEO and other on-page elements covered in our on-page SEO guide.
Keywords in alt text: natural relevance vs stuffing
Alt text is one of the few places where a keyword can sit naturally, and that tempts people into abuse. The honest position is this: a keyword helps only when it accurately describes the image.
If your page targets "India rank tracking" and the image is a screenshot of a rank-tracking table for Indian keywords, then alt="Rank tracking table showing daily positions for 20 India keywords" is both accurate and relevant. You get the SEO benefit as a side effect of an honest description.
What does not work:
- Repeating your target phrase across every image on the page.
- Listing multiple keyword variations inside one
altvalue. - Adding a keyword to a decorative graphic just to place it one more time.
Google's own guidance warns against filling alt text with keywords, calling it a poor experience that can be seen as spam. The relationship here mirrors what we cover in keyword density: forced repetition signals manipulation, while natural usage signals relevance. Treat alt text the way you treat a title tag or a meta description — write for the human, include the term when it fits, and stop there.
Decorative images and when alt text should be empty
Not every image carries information. Background textures, divider lines, decorative flourishes, and spacer images add nothing a reader needs to hear. For these, the correct choice is an empty alt attribute:
<img src="divider.svg" alt="">
An empty alt="" tells a screen reader to skip the image entirely, which keeps the experience clean. This is very different from omitting the attribute altogether. When alt is missing, some assistive technologies fall back to reading the filename aloud — turning hero-bg-final-v3.jpg into an announced string of noise.
The W3C publishes a simple alt decision tree that walks through the choice. In short:
- Informative image (photo, screenshot, diagram): write a description.
- Functional image (button, link icon): describe the action.
- Decorative image (adds nothing): use
alt="". - Complex image (detailed chart, infographic): short
altplus a longer explanation in text or a caption.
Getting the decorative case right is as much a part of image SEO as writing good descriptions, because it keeps your meaningful alt text from being drowned out by noise.
Alt text plus filenames, captions and image sitemaps
Alt text does not work alone. It sits inside a small cluster of signals that together tell search engines what an image is and why it belongs on the page.
Descriptive filenames. blue-running-shoe.jpg beats IMG_4021.jpg. Google reads the filename as a hint, and it also shows up in the image URL. Clean, hyphenated filenames follow the same logic as clean URL structure for pages.
Captions and surrounding text. Google uses the text near an image, including captions, to understand it. A caption is visible to everyone and often carries detail that would make alt text too long. Use the caption for the extended explanation and keep the alt text tight.
Image sitemaps and structured data. For sites with many important images, an image sitemap or image entries in your existing sitemap help Google discover images it might otherwise miss. Structured data, which we cover in the context of semantic SEO, can further clarify an image's role, such as marking it as the primary image of a product or recipe.
Technical image optimization. Compression, correct dimensions, modern formats like WebP, and lazy loading all affect whether an image ranks and whether it slows the page. Fast, well-described images support the broader quality signals discussed in our E-E-A-T SEO guide.
Here is how the pieces map to their jobs:
| Element | Primary job | Visible to users? |
|---|---|---|
alt attribute |
Accessibility and image understanding | Only if image fails to load |
| Filename | Discovery and context hint | In the image URL |
| Caption | Detailed, human-facing explanation | Yes |
| Image sitemap | Discovery of important images | No |
| File format and size | Load speed and rankability | Indirectly, via performance |
Auditing missing and poor alt text across a site
On a real site, alt text problems are not a single missing tag — they are patterns. A template that ships an empty alt on every product photo, a CMS that copies the filename into the alt field, or years of blog posts written before anyone cared. Auditing is therefore a recurring on-page task, not a one-off.
A practical audit process:
- Crawl the site with a tool that reports the
altvalue for everyimgelement. Most technical SEO crawlers do this. - Filter for missing values — images with no
altattribute at all. These are the highest priority because they may be read as filenames. - Flag suspicious values: empty text on clearly informative images, values identical to the filename, values that just repeat the target keyword, and duplicates across many images.
- Prioritize by placement. An image inside main content on a high-traffic page matters far more than a decorative icon in the footer. Fix in that order.
- Re-check on a schedule, because every new article and product adds new images.
This kind of ongoing, page-level monitoring is exactly what a platform like DeployFlare is built to support — surfacing on-page issues such as missing alt text alongside rank tracking and site audits so the fixes get prioritized instead of forgotten. If you are evaluating whether to bring auditing in-house or use a tool, our pricing page lays out what the audit and reporting features cover.
Alt text sits at the intersection of accessibility and image SEO, and the two goals point the same direction. Describe what the image shows, in plain language, for a person who cannot see it. Leave decorative images silent with alt="". Support the description with clean filenames, captions, and a sitemap. Then audit regularly, because the value comes from consistency across every image, not perfection on one.