Alt Text Examples: What to Write for Each Kind of Image

Alt text is the short written stand-in for an image, set in the alt attribute of an img tag. Screen readers read it aloud and browsers show it when the picture fails to load. Good alt text says what the image means in its place on the page; decorative images get an empty alt.

Quick examples by image type
ImageWeak altBetter alt
Logo linking to homelogoSmith Roofing home
Product photoIMG_4021.jpgBrown leather tote bag with brass buckle
Search icon buttonmagnifying glassSearch
Divider swirldecorative swirl(empty: alt="")
Photo of the teampeopleOur four roofers outside the workshop van
Sales chartchartSales by month, details in the table below

Updated

The right words depend on why the image is there, not on what it looks like. A magnifying glass inside a button means Search; the same shape as a page decoration means nothing at all. Try the practice questions, then copy the patterns for your own shop or site.

Practice: pick the best alt text

Your logo sits in the header and links to the home page. Your business name is not written anywhere else in the header.

  • logo.png
  • Harbour Bakery home
  • Our beautiful logo in blue

A thin wavy line separates two sections. It adds no information.

  • wavy line
  • divider image
  • An empty alt (alt="")

The main photo on a product page for a mug that comes in three colours. This is the sage green one.

  • Sage green stoneware mug with a curved handle
  • mug mug coffee mug best mug gift
  • product photo

A button with only a cart icon opens the shopping cart.

  • Shopping trolley icon
  • View cart
  • cart.svg

A banner image with the words Free delivery this weekend. The same words are not on the page as text.

  • Banner
  • Sale banner with red background
  • Free delivery this weekend

0 of 5 answered correctly.

Start again

More examples for shop and business sites

Alt text examples for common business images
Where the image isExample alt textWhy
Hero photo of a cafe interiorSunny cafe counter with fresh pastries on displaySets the scene in a few words
Headshot on an About pageDr. Amira Khan, lead dentistName and role, not hair colour
Social icon linking to InstagramHarbour Bakery on InstagramDescribes the link target
Map screenshot with your address next to it(empty: alt="")The address is already text nearby
Before and after photo of a repaired roofRoof before repair, with missing tiles at the ridgeSays what changes between the photos
Certificate badgeCertified by the regional trade councilSays what the badge certifies

Code examples

Three common cases in HTML

A linked logo, a product photo and a decorative image. Note the decorative one still has the alt attribute, just empty.

<a href="/">
  <img src="/logo.svg" alt="Harbour Bakery home" width="160" height="40">
</a>

<img src="/mug-sage.jpg" alt="Sage green stoneware mug with a curved handle">

<img src="/wave.svg" alt="">

A chart with its data in text

The alt names the chart and points to the details, which sit in a caption that every visitor can read.

<figure>
  <img src="/sales.png" alt="Monthly sales chart, described below">
  <figcaption>Sales rose from 120 orders in March to 210 in June.</figcaption>
</figure>

The W3C decision tree in plain words

First, does the image contain text? If that text also appears nearby as real text, use an empty alt; if not, put the text in the alt. Next, is it inside a link or button? Then describe where the link goes or what the button does.

Does it add meaning? Give simple photos a brief description, and for graphs put the data elsewhere on the page. Is it only decoration? Use an empty alt.

Alt text for online stores

Shoppers who use screen readers rely on product image alt text the way others rely on zooming in. When a product has several photos, make each alt different: front view, back pocket detail, worn by a model who is 170 cm tall.

How it works

  1. Read the situation in each practice card: what the image shows and where it sits on the page.
  2. Choose the alt text you would write from the three options.
  3. The card tells you whether that choice works and which step of the W3C decision tree applies.
  4. Use the table of examples below as a reference when you add images to your own pages.

Tips

  • Skip words like image of or picture of. Screen readers already announce that it is an image.
  • For product photos, name the details a shopper would ask about: colour, material, what makes this variant different.
  • If the same information sits in text right next to the image, an empty alt avoids saying it twice.
  • Never stuff keywords. Google warns that filling alt attributes with keywords may cause your site to be seen as spam.

Frequently asked questions

What does alt mean in text?

Alt is short for alternative. Alt text is the alternative text for an image: the words a screen reader speaks, and what the browser shows in place of a picture that cannot load. It lives in the alt attribute of the img element.

Should every image have alt text?

Every img should have an alt attribute, but not every one needs words. MDN explains that an empty alt marks an image as not a key part of the content. Leaving alt off entirely is worse: some screen readers then read out the file name.

How long should alt text be?

Short enough to say in one breath for most images. The W3C tree asks for a brief description of simple photos. Charts and diagrams are the exception: give a short label in alt and put the full information in text on the page.

Does alt text help SEO?

Yes. Google's image guide says it uses alt text along with computer vision and page content to understand images. Its own example prefers Dalmatian puppy playing fetch over a bare puppy, and warns against keyword lists.

What alt text should a logo have?

If the logo links to your home page, the alt should describe where the link goes, such as your business name plus home. If it is just shown and your name already appears as text beside it, an empty alt is fine.

Related: Image alt text generator, On-page SEO checklist, Social media image sizes, Ecommerce SEO guide.

Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap