Writing alt text with AI? Tell it what the image is for.
The plain request gets a description
Real output · GPT-5.5 (OpenAI API) · Oct 2026
With a plain request, GPT-5.5 gave a 168-character description of the mug, table and fern. It's a fine description, but it doesn't know where the image goes.
Alt text depends on what the image does
W3C's alt decision tree asks what the image does, not what it shows. In a link, say where it goes. Adds meaning, describe it briefly. Decoration only, leave alt empty.
Source: W3C WAI Images Tutorial, updated 13 May 2024
The move: say where it's used
Tested in GPT-5.5 (OpenAI API), Oct 2026
Add one line about where the image sits. Our test gave the model a written description of a fictional photo instead of an uploaded image.
A linked thumbnail gets the product name
Real output · GPT-5.5 (OpenAI API) · Oct 2026
Told it was the only thing inside a link to the Harbor Mug page, it wrote 60 characters led by the product name. The fern, table and steam are gone.
Source: W3C WAI Images Tutorial, Functional Images
A mood banner gets empty alt
Real output · GPT-5.5 (OpenAI API) · Oct 2026
For a blog banner that never mentions the mug, it returned empty alt, which W3C says decorative images should have. In most site editors, leave the field blank or mark it decorative.
Source: W3C WAI Images Tutorial, Decorative Images, updated 27 July 2019
Context helps, but you still trim
In our test, with 'Speckled blue glaze' already printed next to the photo, it still wrote 156 characters. It repeated the glaze and kept the coffee and table. Trimming repeats is still your job.
Write one line before you ask
Before you ask for alt text, write one line: where the image sits, what clicking it does, and what text is already next to it.
Try it: Run your next product photo twice, with and without that line.
Sources and assumptions
- W3C WAI Images Tutorial: An alt Decision Tree (updated 13 May 2024): The tree's questions in order: contains text; used in a link or button ('Use the alt attribute to communicate the destination of the link or action'); contributes meaning ('Use a brief description in the alt attribute', or empty alt if redundant to nearby text); purely decorative ('Use an empty alt attribute'). (checked 2026-10-21)
- W3C WAI Images Tutorial: Decorative Images (updated 27 July 2019): Decorative images should get a null (empty) alt (alt="") so assistive technologies such as screen readers can ignore them. Text values 'would add audible clutter to screen reader output'. (checked 2026-10-21)
- W3C WAI Images Tutorial: Functional Images: 'The text alternative for the image should convey the action that will be initiated (the purpose of the image), rather than a description of the image.' Example: a printer icon gets 'Print this page', not 'printer'. (checked 2026-10-21)
- W3C WAI Images Tutorial: Informative Images: Alt text conveys the meaning shown visually, 'which typically isn't a literal description of the image'. Whether an image is informative or decorative 'is a judgment that authors make, based on the reason for including the image on the page'. The same icon can need text in one context and empty alt in another. (checked 2026-10-21)
Assumptions:
- All four outputs come from GPT-5.5 via the OpenAI API (engine/ai-test.js, run 2026-10-22 UTC = 2026-10-21 local), so label them 'GPT-5.5 (OpenAI API), Oct 2026'. tests.json also has four failed Claude Sonnet 5.5 attempts with output null (the claude CLI errored in this environment). Claude produced no output, so the slides must not name Claude as tested.
- The model got a written description of a fictional photo, not an image file. In real use you'd upload the photo. The slides should say the test used a description.
- The Harbor Mug, the shop and the blog post 'Five Slow Morning Habits' are fictional.
- Character counts: plain prompt 168, link 60, product page 156 (as printed by ai-test.js).
- Empty alt in HTML is alt="". The model's literal output was two quote marks. In site editors (WordPress, Shopify and so on) the usual way is to leave the field empty or mark the image decorative. Keep this generic and don't name product UI steps that weren't verified.
- Each context was a single run. Another run could word things differently.
The short version
- Alt text depends on what the image does.
- Tell the AI where the image is used.
- A link image should name where it goes.
- A mood-only image can get empty alt.
- Check the answer for repeated words.


