Try the Image Alt Checker

alt="" vs No Alt Attribute: Why This Tiny Difference Means "Skip This" or "Announce the Filename"

alt="" and a missing alt attribute look nearly identical in your HTML editor β€” one extra empty-quotes substring β€” but to a screen reader, they mean opposite things: alt="" says "decorative, skip this," while missing alt often triggers an announcement of the filename itself. Here's the practical difference, why every img tag should have an alt attribute (even if empty), and the special case where alt="" on an image-as-link removes the link's accessible name entirely.

By sadiqbd Β· June 14, 2026

Share:
alt="" vs No Alt Attribute: Why This Tiny Difference Means "Skip This" or "Announce the Filename"

Writing alt="" (empty quotes) and omitting the alt attribute entirely look almost identical in your HTML editor β€” but to a screen reader, they mean completely opposite things, and this single, easy-to-miss distinction is one of the most common alt-text mistakes on the web

The previous articles on this site covered alt text basics, writing alt text for SEO/accessibility, image SEO beyond alt text, and the legal landscape around WCAG 1.1.1. This article addresses a specific, frequently-confused distinction: alt="" vs no alt attribute at all β€” two things that look nearly identical in source code, but produce opposite behaviors for assistive technology.


alt="": "this image is decorative β€” skip it"

<img src="divider.png" alt=""> β€” an empty alt attribute (present, but with no text) β€” is the correct, intentional way to mark an image as purely decorative β€” carrying no meaningful content that needs to be conveyed to users who can't see the image.

Screen readers, encountering alt="", skip the image entirely β€” not announcing "image" or any filename/placeholder β€” the image is, effectively, invisible to screen-reader users, exactly as intended for purely decorative elements (visual dividers, background-style flourishes, icons that duplicate adjacent text β€” covered in the original alt-text article's discussion of when alt="" is appropriate).


Missing alt attribute: "unknown β€” announce something, often the filename"

<img src="IMG_4892.jpg"> β€” no alt attribute at all β€” is NOT equivalent to alt="".

Screen readers, encountering an image without an alt attribute, vary in behavior β€” but commonly, they announce something, often including the image's filename/URL β€” <img src="IMG_4892.jpg"> (no alt) might be announced as something like "image, I-M-G underscore 4892 dot jpg" β€” which, for a screen-reader user, is meaningless, disruptive noise β€” conveying no useful information, while still interrupting the reading flow with an announcement.

The practical difference:

alt="" no alt attribute
Screen reader behavior Skips entirely Often announces filename/URL, or "image"
Intended for Decorative images (Nothing β€” this is an error state)
Visual appearance in code alt="" present alt absent

The visual difference in source code β€” alt="" vs the complete absence of an alt= attribute β€” is minimal: one extra alt="" substring β€” easy to overlook when scanning code, and easy to accidentally omit (or, conversely, easy to accidentally include alt="" when alt="meaningful description" was intended, if a templating system substitutes an empty string for a missing/undefined value).


Why this matters: every <img> should have an alt attribute β€” even if it's empty

The "rule" that's sometimes stated as "all images need alt text" is, more precisely: all <img> elements should have an alt attribute β€” its value depends on whether the image is meaningful (descriptive text) or decorative (alt="") β€” but the attribute's presence itself (regardless of value) is what prevents the "announce the filename" fallback behavior.

A page with many <img> tags, none of which have an alt attribute at all (rather than some having meaningful alt text, others having alt="") β€” would, for a screen-reader user, produce a barrage of filename/URL announcements β€” one per image β€” regardless of whether any of those images were "meaningful" or "decorative" β€” because the absence of the alt attribute itself triggers the fallback behavior, independent of what the image "should" have been categorized as.


Detecting this distinction with automated tools

Most automated accessibility/alt-text-checking tools β€” including this site's tool β€” distinguish between alt="" (empty but present) and missing alt (attribute absent entirely) β€” typically flagging the missing case as an issue (regardless of whether the image "should" be decorative or meaningful β€” alt="" would be the correct fix for a decorative image that's currently missing alt entirely; meaningful alt text would be the fix for a meaningful image currently missing alt) β€” while alt="" itself is typically not flagged as an issue (assuming it's applied to genuinely decorative images β€” though some more sophisticated checks might flag alt="" on images that appear, based on context, to be meaningful β€” e.g., an <img> that's also the sole content of a link (<a href="..."><img alt="" ...></a>) having alt="" is generally problematic, since the link would then have no accessible name at all).


The "image inside a link" special case

An image that's the sole content of a link β€” <a href="/products"><img src="shop-icon.png" alt="Shop"></a> β€” the alt text serves as the link's accessible name β€” a screen-reader user, navigating to this link, hears the alt text ("Shop") as the link's label.

If alt="" is used here (perhaps because someone, applying the "decorative images get alt=""" rule too literally, without considering the image's role as a link's sole content) β€” the link becomes inaccessible β€” a screen-reader user encountering this link would have no way of knowing what it does/where it goes (the link might be announced as just "link," with no further information β€” or, depending on the href, possibly the URL itself, which is generally less useful than a meaningful label).

For images-as-sole-link-content: the alt text should describe the link's destination/purpose (e.g., alt="Shop", alt="Go to homepage") β€” not describe the image itself (e.g., not alt="Shopping cart icon", which describes what the image looks like, rather than what clicking the link does) β€” and certainly not alt="", which would remove the link's accessible name entirely.


How to use the Image Alt Checker on sadiqbd.com

  1. For every flagged "missing alt" result: determine, for each such image, whether it's decorative (β†’ add alt="") or meaningful (β†’ add descriptive alt text, per the previous alt-text-writing article's guidance)
  2. For images flagged as having alt="": double-check whether any of these are the sole content of a link β€” alt="" on a link-wrapped image is generally an error, requiring meaningful, link-purpose-describing alt text instead
  3. Don't conflate "has an alt attribute" with "has useful alt text": a page could, in principle, have alt="" on every single <img> (technically "passing" a check for "missing alt attribute") while having zero meaningful alt text anywhere β€” if any of those images were, in fact, meaningful β€” this would represent a significant accessibility failure, despite "technically" having alt attributes everywhere β€” the checker flags missing attributes; whether the present values (including alt="") are the correct choice, for each specific image, requires human judgment, per the previous writing-alt-text article.

Frequently Asked Questions

Why would a screen reader announce a filename for an image with no alt attribute, instead of just skipping it like alt=""? This reflects a design choice in how assistive technology handles "unknown" β€” alt="" is an explicit signal: "this image has been considered, and determined to be decorative β€” skip it." The absence of alt provides no signal at all β€” from the screen reader's perspective, it can't distinguish "this image was deliberately left without alt, because it's decorative, and the developer just forgot the empty-string syntax" from "this image might be meaningful, and alt text was simply never written." **Given this ambiguity, announcing something (even if imperfect β€” a filename) is generally considered less likely to silently hide potentially-meaningful content from the user, compared to silently skipping β€” even though, in practice, filenames are rarely useful announcements either. Neither behavior is "good" for missing-alt images β€” which is exactly why "every <img> should have an alt attribute" is the guidance, removing the ambiguity entirely.

Is the Image Alt Checker free? Yes β€” completely free, no sign-up required.

Try the Image Alt Checker free at sadiqbd.com β€” find every image with a missing alt attribute, and distinguish decorative (alt="") from meaningful images on any page.

Share:
Try the related tool:
Open Image Alt Checker

More Image Alt Checker articles