edubun 한국어

Alternative text for images

A decorative swirl and a sales chart both use the img element, but the right alt text for the first is an empty string and for the second is a full sentence.

What alt text is for

A screen reader turns a page into speech or braille. When it reaches a picture it cannot look at the pixels, so it reads the alt attribute instead. The same text appears when an image fails to load, and it is what a search engine or a text-only browser receives. WCAG 2.2 puts this first of all: success criterion 1.1.1 Non-text Content, at level A, asks that every image, icon or chart that carries information has a text alternative that serves the same purpose.

The key words are "the same purpose". Alt text is not a caption and not a list of everything in the frame. Ask what a sighted reader gets from the picture in this spot, then write that. A photo of a loaf on a bakery's home page might need only "Sourdough loaf, sliced". The same photo in an article about crust colour might need "Sourdough loaf with a dark, almost black crust and an open crumb". Same file, different job, different text.

A short version of the W3C alt decision tree. Images of text take the text itself as alt.

Four common cases

The W3C images tutorial sorts most pictures into a few groups. Informative images, such as a photo or a simple diagram, get a short description of what they show. Decorative images, such as a divider line or a background texture, get an empty alt, written alt="", which tells assistive technology to skip them. Functional images, such as a logo that links home or a magnifying glass that submits a search, get text that says what happens: "Corner Bakery home" or "Search", not "logo" or "magnifying glass". Images of text get the words in the image.

Leaving the attribute out is not the same as leaving it empty. With no alt at all, some screen readers fall back to reading the file name, so a listener may hear something like "IMG underscore 4032 dot jpeg". An empty alt is a deliberate choice that says "nothing to see here". For a complex chart, keep the alt short ("Bar chart of monthly sales, described below") and put the numbers in a table or paragraph next to it, where everyone can read them.

Images that are not img elements

Pictures can also arrive as inline SVG or as CSS background images. A CSS background has no place for alt text at all, so it should be used only for decoration; anything that carries meaning belongs in the HTML. An inline svg that is pure decoration can be hidden with aria-hidden="true", which unit 6 explains. WCAG sets no character limit for alt text, but the W3C tutorial keeps returning to the same advice: be brief and give what matters in this context. If you find yourself writing three sentences, the content probably belongs in the page text where everyone can read it.

You can check your own pages without special software. View the page source and search for <img: every match should have an alt attribute, empty or not. The developer tools in major browsers also include an accessibility panel that shows the name each image ends up with. Reading those names in a row, out of context, is a good test. If a list says "image, image, chart, logo", a screen reader user hears exactly that.

Do not start alt text with "image of" or "picture of". Screen readers already announce that the element is an image, so the words are heard twice.
WCAG 1.1.1Non-text Content, level A: text alternatives for meaningful images
alt=""Decorative: assistive technology skips the image
Functional imageDescribe the action or destination
Image of textAlt repeats the words in the image
Missing altSome screen readers read the file name
Complex chartShort alt plus the data in nearby text or a table
Key points
  • Alt text gives the purpose of the image in its place on the page.
  • Decorative images get alt="", not a missing attribute.
  • Links and buttons made of an image need alt that names the action.
  • Long data belongs in text or a table next to the image.
  1. Which WCAG 2.2 success criterion covers text alternatives?
    • 1.1.1 Non-text Content
    • 1.4.3 Contrast (Minimum)
    • 2.1.1 Keyboard
    • 3.3.2 Labels or Instructions
  2. A wavy line that only separates two sections should have
    • alt=""
    • alt="wavy line"
    • no alt attribute
    • alt="image"
  3. A magnifying-glass image is the only content of the search button. Best alt?
    • Search
    • Magnifying glass
    • Icon
    • Blue magnifying glass on white
  4. What can happen when alt is missing altogether?
    • Some screen readers read out the file name
    • The image is hidden
    • The page will not load
    • The browser invents a description
  5. A banner image shows the words "Open 7 am to 6 pm". Its alt should be
    • Open 7 am to 6 pm
    • Banner
    • Opening hours image
    • alt=""
  6. Why avoid starting alt with "image of"?
    • Screen readers already say it is an image
    • It breaks the HTML
    • Search engines ban it
    • It makes the image larger
  7. Which attribute holds an image's text alternative?
  8. Where should the numbers of a detailed chart go?
    • In a table or text near the chart
    • All inside the alt attribute
    • Nowhere, the chart is enough
    • In the file name
  9. Is alt text the same thing as a caption?
    • No, alt replaces the image; a caption is extra visible text
    • Yes, always
    • Only on mobile
    • Only for photos
Sources for this course (7)
  • W3C, Web Content Accessibility Guidelines (WCAG) 2.2, W3C Recommendation first published 5 October 2023, current edition 12 December 2024 (w3.org/TR/WCAG22/, checked 2026-10-17, rechecked 2026-10-18)
  • W3C WAI, What's new in WCAG 2.2 (w3.org/WAI/standards-guidelines/wcag/new-in-22/, checked 2026-10-17)
  • W3C WAI, Images tutorial and alt decision tree (w3.org/WAI/tutorials/images/decision-tree/, checked 2026-10-17)
  • W3C, Using ARIA (w3.org/TR/using-aria/, Discontinued Draft 24 February 2026, rules 1 to 4, checked 2026-10-17)
  • W3C WAI-ARIA Authoring Practices Guide, Read Me First, "No ARIA is better than bad ARIA" (w3.org/WAI/ARIA/apg/practices/read-me-first/, checked 2026-10-17)
  • MDN Web Docs, tabindex (developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/tabindex, checked 2026-10-17)
  • MDN, Heading elements, accessibility notes (developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements, checked 2026-10-17)

Checked: 2026-10-17