Guide
Images of text: when the alt text is the words
Some pictures are not pictures of anything. A circular photographed on a desk, a quote on a coloured card, a screenshot of a message: what they carry is words, and the alt text that does their job is those words.
The words are the description
The W3C decision tree asks early whether an image contains text, because the answer changes the job. A photograph of a beach is described; a photograph of a notice is read. Describing the notice — “a white page with black printed text and a stamp” — tells a listener exactly what they are missing and nothing of what it says.
So the alt text of an image of text is its text: the words of the quote, the heading and key line of the notice, the message in the screenshot. Typography, background and colour are left out unless they mean something.
Short, long and essential
Short text
A button with words on it, a sign, a quote card, a single message: put the words in the alt attribute, as written. Up to about 250 characters this is the whole answer.
Long text
A circular, a page of a form, a long chat: the alt says what the picture is — “A circular from the school about the October holiday, in Hindi” — and the text itself goes on the page, as real text, where it can be read, searched and translated.
When the picture is the point
A logo, or a screenshot that shows what an error message looked like, is an image of text on purpose. WCAG 1.4.5 allows these. The alt still gives the words, and for a screenshot, enough of the context to know why it is there.
