The right alt depends on the image's ROLE, not its content. Write the alt in context, pick its role: see what the screen reader reads, what the browser draws…
Why it matters
Every <img> without the right alt = a message lost for screen reader users, and the alt is also what shows when the picture fails to load. A wrong alt (a long description on a decoration, or alt="" on key information) is as bad as a missing one. It is the most common accessibility audit finding.
The key idea
No alt is good everywhere: the right one depends on the image’s role
Common mistakes
The alt is read as "image, image of a sales chart", odd to the ear The screen reader already says "image" itself. Do not start with "image/photo/image of", go straight to the content: alt="Sales rose 40% from January to March".
The file name is read out though the picture is only decorationalt="" = deliberately hidden (right for decoration). Without an alt attribute, screen readers fall back to the file name. For a decoration write alt="" explicitly.
A decorative picture given a long description that only adds noise A "correct" description is noise when the picture is only decoration. Ask first: does this picture add information? If not, alt="".
Try it in this playground
Open A decoration without alt and press "Read on" With no alt attribute, the screen reader reads its file name: "garis-hiasan.svg, image".
Compare alt="" and no alt on a picture that fails to load An empty alt: the browser draws nothing. No alt: a broken icon. With an alt: its text.
Change its role for the same HTML The same alt can be right as informative and wrong as decorative.
Open A text banner and write its alt Text inside a picture is not machine-readable: the alt must carry that text.