Skip to content
AnyToPrompt

Writing good alt text with AI, and knowing when to change what it gives you

How to write alt text with AI: what alt text is for, how long it should be, decorative images, SEO versus accessibility, and good and bad examples.

The AnyToPrompt team · · 6 min read

Alt text is the text alternative for an image. Screen readers read it aloud to people who can’t see the picture, browsers show it when the image fails to load, and search engines use it to understand what the image shows. It lives in the alt attribute of an image tag, or in the “alt text” field of whatever CMS, social platform or document editor you use.

AI describers are good at producing a first draft quickly. They are not good at knowing why the image is on your page, and that is the part that decides what good alt text says. This guide covers both halves: getting a useful description from AI, and editing it into alt text that actually helps someone.

What alt text is for

The test is simple: if the image disappeared and the alt text were read in its place, would the reader lose anything that matters? Alt text replaces the image’s function on the page, not every pixel in it.

That is why the same photo can need different alt text in different places. A picture of a golden retriever on a beach might be:

  • On a dog-grooming page: “Golden retriever with a freshly trimmed, short summer coat.”
  • On a travel page about a beach: “Dog running along the wide sandy beach at low tide, dunes in the background.”
  • On a product page for a dog harness: “Golden retriever wearing the red harness with reflective straps.”

An AI describer sees the same pixels in all three cases. Only you know which detail is the point.

How long should alt text be?

There is no official character limit. Most good alt text is one sentence, and often shorter. Describe what matters and stop. Long alt text is tiring to listen to, and screen-reader users can’t skim it the way sighted readers skim a caption.

When an image genuinely needs more explanation, such as a chart, a diagram or an infographic, write a short alt text that says what it is and what it shows, then put the full explanation in the surrounding text or a caption where everyone can read it.

Too long:

A bar chart with a white background and grey gridlines showing five blue bars of different heights, labelled January to May along the bottom axis, with numbers on the left axis going from 0 to 500 in steps of 100, and a title at the top.

Better:

Bar chart of monthly sign-ups, rising steadily from January to May.

The data itself belongs in the article or in a table next to the chart.

Things to leave out

  • “Image of” or “picture of.” Screen readers already announce that it is an image. Do mention the medium when it matters: “Screenshot of…”, “Pencil sketch of…”, “Logo of…”.
  • Information already in the caption or nearby text. Repeating it means a screen-reader user hears it twice.
  • Guesses about things you can’t see. AI descriptions sometimes assume age, ethnicity, gender, emotions or relationships. Include personal characteristics only when they are relevant and you actually know them.
  • Keyword lists. More on that below.

Decorative images

Some images carry no information: background textures, divider flourishes, a stock photo that only adds atmosphere next to a heading that already says everything. These should have an empty alt attribute, written as alt="", so screen readers skip them entirely.

An empty alt is not the same as a missing one. If the attribute is missing altogether, many screen readers fall back to reading the file name, so the listener hears something like “IMG underscore 4021 dot jpeg”. Leave it empty on purpose for decoration, and never leave it out by accident.

Icons are a common edge case. A magnifying-glass icon inside a search button needs alt text that names the action (“Search”), not the drawing (“magnifying glass”). If the button already has visible text next to the icon, the icon is decorative.

SEO versus accessibility

Search engines do read alt text, and descriptive alt text helps images appear in image search. But the best alt text for SEO is simply accurate alt text. Writing for search engines first tends to produce this:

Bad:

best hiking boots waterproof hiking boots men hiking boots sale

Good:

Brown leather hiking boot with a deep-lugged sole, standing in a shallow stream.

The good version naturally contains the term “hiking boot” because that is what the picture shows. Keyword stuffing makes the page worse for screen-reader users and is treated as spam by search engines. If the alt text sounds natural read aloud, it is doing both jobs.

Using AI to draft alt text

An AI describer gives you a complete, neutral description in seconds, which is a much better starting point than a blank field, especially when you have hundreds of product photos or an archive of old blog images. Upload a picture to our image describer and you get plain prose describing subject, setting, colours and visible text.

Then edit it. A good review takes under a minute per image:

  1. Cut to purpose. Delete everything that doesn’t serve the reason the image is on the page.
  2. Check facts. Make sure colours, counts, and especially any text in the image are correct. AI can misread small or stylised lettering.
  3. Remove assumptions. Strip out guesses about identity, mood or intent that you can’t confirm.
  4. Add what only you know. Names of products, places or people (with permission) that the model couldn’t identify.
  5. Read it aloud. If it sounds awkward spoken, rewrite it.

A worked example

AI description of a photo on a bakery’s “About” page:

A smiling woman in her thirties wearing a white apron stands behind a wooden counter in a bright bakery. Shelves behind her hold loaves of bread and baskets of pastries. Warm light comes from pendant lamps. She appears happy and welcoming. The image has a cozy, inviting atmosphere.

Edited alt text:

Head baker Ana behind the counter, with shelves of fresh loaves and pastries behind her.

The age guess and the mood commentary are gone, the lighting is gone because it doesn’t matter here, and the name, which the model couldn’t have known, has been added.

Alt text for text in images

If an image contains words that matter, such as a quote card, a poster or a screenshot of a message, the alt text must include those words. A screen-reader user can’t get them any other way. For a quote card, the alt text is mostly the quote itself plus who said it. If the text is long, put it in the body of the page instead and keep the alt short.

Descriptions beyond alt text

The same describer output is useful for more than accessibility. Product teams use it for listing copy, archivists for catalogue records, and people working with image generators use detailed descriptions as a starting point for prompts. The difference is length and purpose: alt text is short and functional, while a prompt wants every visual detail. If that’s your goal, our image to prompt app produces prompt-ready descriptions, and how to reverse-engineer an image into a prompt explains the workflow. For writing prompts from a short idea rather than an image, see turning a short idea into a full prompt.

Checklist

  • Ask what the image does on this page, and describe that.
  • Usually one sentence; put long explanations in the page text.
  • Skip “image of”; mention the medium when it matters.
  • Use alt="" for purely decorative images, and never leave the attribute out.
  • Include any meaningful text that appears in the image.
  • Write naturally; no keyword lists.
  • Treat AI output as a draft: cut, fact-check, remove assumptions, add context.