Images must have alternate text

Rule ID: image-alt
Ruleset: axe-core 3.0
User Impact: Critical
WCAG: 1.1.1

What if your accessibility tools could do more?

Axe can catch a lot of accessibility issues, but what if accessibility tools could do more? Join our beta program for a new tool that takes an exciting new approach to accessibility testing.

Compliance Data & Impact

User Impact

Disabilities Affected

  • Blind
  • Deafblind

Requirement(s)

  • WCAG 2.1 (A): MUST
  • WCAG 2.0 (A): MUST
  • Section 508: MUST

WCAG Success Criteria

  • 1.1.1 Non-text Content

Section 508 Guidelines

  • 1194.22 (a) Text equivalent for non-text elements

How to Fix the Problem

Ensure all informative <img> elements have short, descriptive alternate text and all decorative <img> elements have empty alt attributes (e.g. alt="").

There are three main ways to add alternate text to an image:

  • Using an alt attribute i.e. <img alt="drawing of a cat" src="...">
  • Using an aria-label i.e. <img aria-label="drawing of a cat" src="...">
  • Using an aria-labelledby attribute i.e. <img arialabelledby="someID" src="...">

Alt Text Writing Tips

When writing alt text, keep in mind that its purpose is to relay information to blind users about the image’s contents and purpose - blind users should be able to get as much information from alt text as a sighted user gets from the image itself. Alt text should give the intent, purpose, and meaning of the image.

When writing alt text, it is helpful to keep the following questions in mind:

  • Why is the non-text content here?
  • What information is it presenting?
  • What purpose does it fulfill?
  • If I could not use the non-text content, what words would I use to convey the same information or function?

Be sure that all text contained in the attribute is useful. Words like "chart," "image," "diagram," or image file names tend not to be very useful and thus should not be used in alt text.

Decorative Elements

Provide "null" alt attributes (using alt="") for images which do not provide information or do not require alternative text because the image is described in the page content. Some developers will mistakenly leave off the alt attribute altogether on images which they deem do not need alternatives. This is not helpful to assistive technology users because the assistive technology, such as screen reader, will often read the source attribute (i.e., file name) as the alternative text. To tell assistive technology to ignore an image, use a "blank alternative text" attribute: alt="".

Example:

<img src="line.jpg" alt="">

Why it Matters

Screen readers have no way of translating an image into words that gets read to the user, even if the image only consists of text. As a result, it's necessary for images to have short, descriptive alt text so screen reader users clearly understand the image's contents and purpose.

If you can't see, all types of visual information, such as images, are completely useless unless a digital text alternative is provided so that screen readers can convert that text into either sound or braille. The same is true in varying degrees for people with low vision or color-blindness.

When you do not provide an acceptable alternative that works for their available sensory modalities, such as making an image accessible by providing a digital text description, screen readers cannot convert it into speech or braille to make it available by sound or touch.

Rule Description

All images must have alternate text to convey their purpose and meaning to screen reader users.

The Algorithm (in simple terms)

Ensures that every <img> element has alternative text and either role="presentation" or role="none" (ARIA 1.1).

Resources

Refer to the complete list of axe 3.0 rules.

Was this information helpful?

You have already given your feedback, thank you..

Your response was as follows:

Was this information helpful?
Date/Time feedback was submitted: