Alt text should convey the same information or function the image conveys in context — not a literal catalog of every visual detail. If the image is a bar chart of Q3 revenue, say that. If it is a search button, alt="Search" is enough. If it is pure decoration, use alt="" (empty, not omitted) so screen readers skip it.
Bad patterns that waste the attribute
alt="image1.jpg" tells a screen-reader user the filename, not the meaning. alt="photo" is equally empty — every photo is a photo. The other failure mode is the opposite: a paragraph of decorative prose that narrates irrelevant visual detail (“beautiful sunset with orange clouds and a small bird on the left”) when the image’s job on the page is just to look pretty. That noise slows everyone down and still fails to state a function when one exists. If you cannot finish the sentence “without this image, the user would miss ___,” you do not have alt text yet.
Good examples by image type
Informative image (data or content the page relies on): alt="Bar chart showing Q3 revenue up 12% over Q2" — the takeaway, not the pixel colors. Functional image (controls): a magnifying-glass icon that submits search should be alt="Search" — describe the action, not “gray magnifying glass icon.” Complex images (maps, dense diagrams) may need a short alt plus a longer description elsewhere on the page; the alt still names the topic so users can decide whether to dig in. When the image is the only place a fact appears, that fact belongs in the alt (or in visible text next to it).
Decorative images and empty alt
Purely decorative images should use alt="" — an empty string — so assistive technology skips them. Omitting the alt attribute entirely is different: many browsers and AT then announce the filename or “image,” which is the opposite of silence. Spacer GIFs, rounded-corner flourishes, and stock photos that add no information are decorative. If marketing insists the hero “sets the mood” but the headline already says everything, empty alt is correct; if the hero is the only place the product name appears, it is not decorative.
What alt text is for (the one-line rule)
Write as if the image disappeared and you had to replace it with text for someone who cannot see it. Same information. Same function. Not a visual essay. That single rule collapses most arguments about length: a logo that is also a home link needs the site name (and that it goes home, if the link purpose is not obvious elsewhere); a product shot in a gallery needs the product identity, not the softbox lighting.
Applying alt when images live in a PDF
Web <img alt> habits carry into documents. When you assemble a PDF from images — ID photos, scanned receipts, slide exports — someone still has to supply equivalent text or the file is a flat picture for assistive tech. SortMyFile’s Accessible Images → PDF flow asks for alt text notes while you build the PDF so you do not ship a stack of unnamed images. Pair that with OCR when the “image” is really a scan of text that should be selectable. Filename leftovers and “photo” placeholders fail in PDFs for the same reason they fail on websites.
Try it now
Open the matching SortMyFile tool — processing stays in your browser.