Good Alt Text Depends on What the Image Does Here

Illustrated stack of abstract image cards with smooth and pixelated patterns
AI-generated conceptual illustration, not a product photograph or software screenshot.

The same image can need different alternative text in different places. A photograph used to explain a detail has a different role from a decorative image beside text that already says everything necessary.

Ask about purpose first

The W3C WAI alt decision tree distinguishes informative, functional and decorative situations. A functional image needs an alternative that communicates its purpose, while a purely decorative image can use an empty alt attribute.

An empty attribute is not the same as forgetting to consider the image. It should follow a deliberate decision about the surrounding content.

Try a contextual example

Imagine a diagram that highlights which socket accepts a particular connector. The useful alternative concerns that identified socket and relationship, not a long inventory of every colour on the desk.

If the image contains complex information, provide an adequate explanation in the page as well. A short label cannot carry an entire data chart.

Read the page without the picture

Check whether the alternative preserves the information or action a reader needs. Remove redundant wording and avoid stuffing unrelated search phrases into the text.

Pair this with choosing an image format. A well-prepared image needs both suitable visual delivery and a meaningful role for readers who encounter the page differently.