UX Robot guide

How to add alt text to images, with real examples

How to add alt text to images in HTML, WordPress, Shopify, Squarespace, Word and Google Docs, how to write it well, and real examples of good and bad alt text.

By the UX Robot teamUpdated 16 minute read

A photo of your product means nothing to someone who cannot see it, unless you tell them what it shows. That is the job of alt text. This guide shows how to add alt text to images in the tools you already publish with, how to decide what to write, and what good and bad alt text looks like on real pages.

It covers plain HTML, WordPress, Shopify, Squarespace, Microsoft Word, PowerPoint and Outlook, and Google Docs and Slides, with the steps each tool’s own help pages describe today. Then it walks through the questions that decide what an image needs, a table of examples by type of image, and a real logo link from a UX Robot audit that still has nothing to say.

In short

  • Alt text is a short written replacement for an image, read aloud by screen readers and shown when the image does not load.
  • Every tool has an alt text field in the image’s settings; in HTML it is the alt attribute on the img tag.
  • Write what the image means in its place on the page, in a few words, not what a camera would see.
  • An image inside a link or button needs alt text that says where it goes or what it does.
  • Purely decorative images get an empty alt, alt="", so screen readers skip them.

What is alt text?

Alt text, short for alternative text, is a written description attached to an image that does the image’s job when it cannot be seen. Screen readers read it aloud, browsers show it when the image fails to load, and search engines use it to understand what the image shows.

In a web page, alt text lives in the alt attribute of the image tag. Visitors who can see the image never notice it. For someone who is blind and listening to the page with a screen reader, it is the only thing the image says. For someone on a slow connection, it is what appears in the empty box while the picture loads, or in place of it if it never does.

Alt text is not a caption. A caption sits under the image for everyone to read, while alt text replaces the image for people who cannot see it. It is also not the image’s title or file name. A file called IMG_4021.jpg tells nobody anything, and some screen readers will read that file name aloud when an image has no alt attribute at all.

Why alt text matters, in numbers

Missing alt text is the second most common accessibility failure on the web. WebAIM’s 2026 test of the top million home pages found it on 53.1% of them, second only to low contrast text, and the accessibility standard most laws refer to requires it at its most basic level.

53.1% Of the top million home pages had images with missing alternative text (WebAIM, February 2026).
10.8 Images missing alt text on the average home page, 16.2% of all home page images (WebAIM, 2026).
45% Of the images missing alt text were inside links, so the link had nothing to say (WebAIM, 2026).
10.8% Of images that did have alt text used questionable text such as “image”, “graphic” or a file name (WebAIM, 2026).

There is some good news in the same report: WebAIM found that the share of images missing alt text “dropped from 18.5% in 2025” to 16.2% in 2026. But one in every four linked images still had none, and those are the costly ones, because a link made only of an image with no alt text gives a screen reader user a link with nothing to say. They hear that there is a link, and perhaps its web address, but not where it goes.

Three reasons make alt text worth the minute it takes:

  • People. Blind and low vision customers who use screen readers rely on it to understand products, charts and buttons. Without it, they miss information or cannot use a control at all.
  • The standard. The Web Content Accessibility Guidelines make text alternatives their very first rule, success criterion 1.1.1, Non-text Content, at level A, the most basic level. Non-text content needs “a text alternative that serves the equivalent purpose.” Our ADA compliance checklist explains how that standard connects to the law in the United States.
  • Search. Google says in its image SEO best practices that “the most important attribute when it comes to providing more metadata for an image is the alt text.” When an image is a link, its alt text also works as the link’s anchor text.

How to add alt text to images, tool by tool

Select the image, open its settings or details, and type into the field called Alt text or Alternative text. In HTML, add an alt attribute to the img tag. Every tool below has the field; only its place in the menus differs. The steps follow each tool’s own help page as of November 2026.

In HTML

Add the alt attribute to the image tag, with the text inside the quotes. A decorative image gets the attribute with nothing between the quotes, which tells screen readers to skip it. Never leave the attribute out, because then some screen readers read the file name instead.

<!-- An informative image -->
<img src="dalmatian.jpg" alt="Dalmatian puppy playing fetch">

<!-- A logo that links to the home page -->
<a href="/"><img src="logo.svg" alt="Happy Menu home"></a>

<!-- A decorative flourish -->
<img src="divider.svg" alt="">

In WordPress

In the block editor, according to the Image block documentation:

  1. Select the image blockClick the image in the post or page you are editing.
  2. Open the block settingsIf the sidebar is hidden, click the Settings button next to Save or Publish.
  3. Find Alternative text on the Content tabType the description, or tick Mark as decorative for an image that adds nothing.
  4. Save or update the postThe alt text is published with the page.

Alt text typed in the block applies only to that post. To set a default for an image wherever it is used, open Media, then Library, click the image to open Attachment Details and fill in Alt Text; the change saves on its own. WordPress uses that text when the image is inserted later, so set it once when you upload.

In Shopify

For product images, Shopify’s help page on alt text gives these steps on a computer: go to Products and click the product, click an image to open Preview media, click Add alt text, type it, click Save alt text and close the preview. In the mobile app, tap the image, then Information, type the text and save.

Shopify allows up to 512 characters and recommends 125 or fewer. Its media editor may also suggest alt text for you. Treat a suggestion as a first draft: it can describe what is in the photo, but only you know why the photo is on the page, such as the color that is out of stock or the detail that sets this product apart.

In Squarespace

For an image block, open the page and click Edit, click the image block, then the pencil icon, and type into Image alt text on the Content tab. For product images, Squarespace uses an Alt text field under Edit metadata on the image. Its help center notes that some images, such as section background images, do not take alt text, so put anything important in those images into the page’s text as well.

In Word, PowerPoint and Outlook

Microsoft’s guide to alternative text works the same way in Word, PowerPoint and Excel: right-click the picture and choose View Alt Text, or select it and choose Picture Format, then Alt Text. Type one or two sentences in the Alt Text pane. In Outlook, right-click and choose Edit Alt Text. For a decorative shape or line, tick Mark as decorative instead, and the text box is grayed out.

In Google Docs and Slides

Select the image, choose Image options, then Alt text, and type the description. The keyboard shortcut is Ctrl + Alt + Y on Windows and ChromeOS, or Command + Option + Y on a Mac, as Google’s help page lists. In Google Sheets, select the image, open its More menu and choose Alt text.

In any other tool

Website builders, email tools and design apps almost always have the field, usually in the image’s settings, details or accessibility panel, labeled Alt text, Alternative text or Image description. Search the tool’s help center for “alt text” to find it. If a tool has no field at all for an image that carries meaning, put that meaning in the text next to the image instead.

How to write good alt text

Ask why the image is on the page, then write the few words that do the same job for someone who cannot see it. Describe its meaning in context, not every visible detail. Keep it brief, skip “image of”, and do not repeat text that is already next to the image.

The W3C’s alt decision tree turns that into a handful of questions. Work through them in order and stop at the first one that fits:

  1. Does the image contain text?If the same words are already on the page, or are only there for visual effect, use an empty alt. If it is an icon with a job, describe the job. Otherwise, the alt text repeats the words in the image.
  2. Is it inside a link or a button?Then the alt text says where the link goes or what the button does, such as “Happy Menu home” or “Print this page”.
  3. Does it add meaning to the page?For a photo or simple graphic, write a brief description of that meaning. For a chart or diagram, give a short alt and put the full information in the page’s text or a table.
  4. Is it there only for decoration?Use an empty alt, alt="", so screen readers skip it.
  5. Still not sure?The tree does not cover every case. Ask what a person reading the page aloud to a friend would say about the image, and write that.

Then apply a few rules that hold for almost every image:

  • Context decides. The same photo of a chef can need “Head chef Maria plating the tasting menu” on an About page and an empty alt on a menu page where it is only atmosphere. Whether an image is informative or decorative, as the W3C puts it, is a judgment authors make “based on the reason for including the image on the page.”
  • Keep it short. WebAIM’s guidance is that “typically, only a few words are necessary, though rarely a short sentence or two may be appropriate.” A long description belongs in the page text, where everyone can read it.
  • Skip “image of” and “picture of”. Screen readers already announce that it is an image, so the words are heard twice.
  • Do not repeat the text around it. If the caption or the heading next to the image already says it, the image is decorative in that place.
  • Do not stuff keywords. Google warns that filling alt attributes with keywords “may cause your site to be seen as spam.” Write for the person, and the right words follow.

Google’s own example shows the progression well. A puppy photo with no alt text is bad. A long string of puppy keywords is also bad. The single word “puppy” is better. “Dalmatian puppy playing fetch” is best, because it tells a person and a search engine what is actually happening in the picture.

Alt text examples for each kind of image

Good alt text changes with the kind of image. A product photo needs the details a shopper would ask about, a logo link needs its destination, an icon button needs its action, an image of text needs the same words, a chart needs its main point and a decorative image needs nothing.

The examples marked as real are from Happy Menu’s home page, a restaurant discovery app whose owner lets UX Robot publish its audits, as we read them on November 16, 2026. The others show the pattern.

Alt text by kind of image
Kind of imageWeak alt textBetter alt text
Screenshot that shows a featurescreenshotReal: The Chiki Chiki restaurant page with its menu and prices
Product photoShoeWomen’s trail running shoe in navy with an orange sole
Logo that links homeNo alt attribute (real, in the page header)Real, in the same page’s footer: Happy Menu; clearer still: Happy Menu home
Image of text, such as a store badgebadgeReal: Download on the App Store
Icon buttonprinter iconPrint this page
ChartchartBar chart of monthly sign-ups, which doubled from March to June, with the numbers in a table below
Decorative divider or background shapedecorative swirlalt=""

Look at the store badge. It is a picture of words, so its alt text is simply those words; there is no need to say it is black or has an Apple logo. The screenshot alt text works because it says what the screenshot proves, a restaurant page with its menu and prices, not how many pixels of gray sit around it. And the chart alt text leads with the point the chart makes, which is the reason the chart is there.

A real example: the logo link with nothing to say

On Happy Menu’s home page, the logo at the top is an image with no alt attribute, and it is the only thing inside the link to the home page. UX Robot’s audit measured it as a link with no name. The fix is one attribute.

UX Robot audited the page on a phone in October 2026 and marked the logo on the screenshot. Its free check on November 6 listed the same element twice, once as an image with no alt attribute and once as a link with no name, among six accessibility failures.

Link with no nameMeasured
The Happy Menu logo at the top left of the home page on a phone, an image with no alt text inside the home link, marked with a red box
The logo image has no alt text, so its home link has no words for screen readers or Google.
Automated accessibility checksMeasured
Accessibility score of 78 for happymenu.co with six failed checks: hidden elements that can still take focus, low contrast text, an image with no alt attribute, a link with no name, zoom turned off and no main landmark
UX Robot’s free check on November 6, 2026: the missing alt attribute and the link with no name are one problem with one fix.

Here is what that means for a customer using a screen reader. They move through the page by links, which is one of the quickest ways to get around, and the first link they reach has no words. Depending on the screen reader, they hear “link” on its own or the link’s web address. A sighted visitor knows at a glance that the logo goes home; the screen reader user has to guess.

The instructive part is the footer of the same page. When we read the page on November 16, 2026, the footer logo, the same image file inside another home link, had alt="Happy Menu", while the header logo still had no alt attribute. The same image needed alt text twice, and got it once. That is how most missing alt text happens: not from a decision, but from a template or component that nobody gave a field to fill in.

<!-- Before: the header logo -->
<a href="/"><img src="/storage/images/logo.svg"></a>

<!-- After -->
<a href="/"><img src="/storage/images/logo.svg" alt="Happy Menu home"></a>

For a logo inside a link, the W3C’s guidance on functional images uses “W3C home” as its example: the name, plus where the link goes. If the link already has the website’s name as visible text next to the logo, the logo gets an empty alt instead, so the name is not read twice. You can see how this finding sat in the whole report in our SEO audit example, where the same missing attribute failed both an accessibility check and a search check.

Decorative images, charts and other special cases

Decorative images get an empty alt so screen readers skip them. Linked images describe the destination. Images of text repeat the text. Charts and diagrams need a short alt plus the full information in the page itself.

Decorative images

  • Use alt="" with nothing between the quotes, never leave the attribute out.
  • In WordPress and Microsoft Office, tick Mark as decorative instead of typing anything.
  • Where you can, add purely visual images as CSS backgrounds rather than img tags.
  • Icons next to a text label, such as a phone icon beside “Call us”, are usually decorative.

Images in links and buttons

  • Say where the link goes or what the button does, not what the picture looks like.
  • Leave out “link to” and “click here”; screen readers already say it is a link.
  • If the link also has visible text, give the image an empty alt so the text is not read twice.
  • A logo alone in a home link gets the name and “home”.

Images of text

  • The alt text contains the same words shown in the image.
  • Prefer real text styled with CSS; it scales, translates and can be searched.
  • Logos are the accepted exception to avoiding images of text.
  • For a flyer or an infographic, put its full text in the page, not in the alt.

Charts, diagrams and maps

  • Write a short alt that names the chart and its main point.
  • Give the full data in a table or a paragraph next to it, which helps every reader.
  • Do not rely on the old longdesc attribute; WebAIM notes that it is deprecated.
  • For a map, list the places or directions it shows in text.

One more case is growing fast: alt text written by AI. Tools now suggest descriptions on upload, and they are a fair starting point for a photo. But they describe what is in the picture, not why it is on your page, and they cannot know that a screenshot is there to prove a feature or that a chart’s point is the jump in June. Read every suggestion and rewrite it for its place on the page.

How to check the alt text on your website

An automated check finds images with no alt attribute in seconds. Only a person can tell whether the alt text that is there is any good, so check both: run a tool for the missing ones, then read the alt text of your most important pages aloud.

  1. Run an automated check on your home page and your most visited pages. It will list images with no alt attribute and links or buttons with no name.
  2. Look at the templates, not just the pages. Headers, footers, product cards and article lists repeat on every page, so one missing alt in a template is missing everywhere, as Happy Menu’s header logo shows.
  3. Read the alt text in context. In your browser, right-click an image and choose Inspect to see its alt attribute. Ask whether the words would do the image’s job if the image vanished.
  4. Try a screen reader for five minutes. VoiceOver is built into Mac and iPhone, and NVDA is free for Windows. Move through the links on your home page and listen for any that say nothing useful.
  5. Write a rule for whoever publishes. One paragraph in your content guide, with three examples from your own website, prevents most new problems.

Missing alt text is rarely a website’s only accessibility problem. On Happy Menu’s page it sat beside low contrast text and zoom turned off, which is typical; our guide to WCAG AA and AAA explains which level to aim for. UX Robot helps with the rest of the work: your own AI agent audits a page for usability and WCAG 2.2, marks each problem on a screenshot, says whether it was measured or judged and gives the fix. The Free plan includes five page audits a month, Pro gives unlimited page audits, and Enterprise audits whole journeys with your connected data, sends issues to your tracker and rechecks them after you ship. See the plans or how page audits work.

Alt text questions people ask

How long should alt text be?

As short as it can be while doing the image’s job, usually a few words and rarely more than a sentence or two. WCAG sets no limit. Some tools do: Shopify allows 512 characters and recommends 125 or fewer. If an image needs a long explanation, put it in the page text.

Why is alt text showing instead of the image?

The image did not load. The file may have moved or been renamed, the address in the page may be wrong, the connection may be slow, or a browser setting or extension may be blocking images. That is exactly the moment alt text is for, which is one more reason to write it well.

Does alt text help SEO?

Yes. Google calls alt text the most important attribute for giving it information about an image, and uses the alt text of a linked image as the link’s anchor text. Write it for people first and avoid stuffing it with keywords, which Google says can look like spam.

Do decorative images need alt text?

They need an alt attribute, but an empty one: alt="". That tells screen readers to skip the image. Leaving the attribute out entirely is a failure, because some screen readers then read the file name aloud.

How do I write an image description for a chart or infographic?

Give the image a short alt text that names it and its main point, then put the full information in the page as text or a table. The W3C calls this a two-part text alternative: a short description to identify the image and a long description of its essential information.

Should alt text say “logo”?

Usually not. For a logo inside a home link, the name and the destination, such as “Happy Menu home”, are what matter. WebAIM notes that the word logo is usually not an important part of the image’s content or function.

Sources

  1. The WebAIM Million, WebAIM, 2026 report from February 2026 tests: missing alternative text on home pages and images.
  2. Understanding success criterion 1.1.1: Non-text Content, W3C.
  3. An alt decision tree and Images tutorial, W3C Web Accessibility Initiative.
  4. Functional images, W3C Web Accessibility Initiative.
  5. Alternative text, WebAIM.
  6. Image SEO best practices, Google Search Central.
  7. Image block and Media Library screen, WordPress documentation.
  8. Adding alt text to product media, Shopify Help Center.
  9. Adding alt text to images, Squarespace Help Center.
  10. Add alternative text to a shape, picture, chart, SmartArt graphic, or other object, Microsoft Support.
  11. Add alt text to images in Google Docs, Sheets and Slides, Google Docs Editors Help.
  12. UX Robot audit of happymenu.co on a phone, October 2026, its free check on November 6, 2026, and the page as read on November 16, 2026, published with the owner’s permission.

Put this guide to work

Check your own page in about a minute.

Type your page’s address and UX Robot shows how fast it is for real visitors, how accessible it is and what search engines see, free and without signing up.

Then your own AI agent can audit the whole page for usability and WCAG 2.2, five pages a month on the free plan. See the plans

How does your page do?

Check it free