Not sure what your png alt text should say? Describe what the image does on that page, keep it short, and use an empty alt when it is purely decorative.
If you are still choosing a file type, the guide to the best image format for websites covers that decision first.
| Item | Value |
|---|---|
| Where the text goes | The alt attribute of the img element |
| Purely decorative image | An empty alt attribute |
| Image of text found nowhere else | The text on the image |
| Image inside a link or button | The destination of the link or action taken |
| Graph or complex image | The information included elsewhere on the page |
These rules come from the Web Accessibility Initiative’s alt decision tree and the HTML alt techniques draft. Both pages are drafts, so the guidance can change: check the source before you rely on it.
What png alt text is and why it matters
Alt text is the alt attribute on an img element, so it works the same whatever format the file uses. The HTML alt techniques draft says the attribute can be placed on any img element.
Its job is to supply a text alternative. Someone who cannot see a picture can have that text read aloud with synthesized speech, as the same draft explains.
The text reaches several audiences, according to the draft:
- People who hear the page through speech output.
- Web search engines and in-page searches, which also process the text.
- Anyone whose image is broken or unavailable, has image display switched off, or uses a text-mode browser.
Context decides the wording. The draft gives a company logo as the example: it can be identity branding on a home page and a navigation icon on other pages, so the same image may need different alt text in different places. Source
How do you decide what to write?
The Web Accessibility Initiative publishes an alt decision tree that covers the alt attribute of the img element in various situations. You can read it here. Work through its questions in this order:
- Does the image contain text?
- Is the image used in a link or a button, and would it be hard or impossible to understand what the link or button does without the image?
- Does the image contribute meaning to the current page or context?
- Is the image purely decorative or not intended for the user?
Some images have a better route than alt. The tree notes that CSS background images can serve decorative images and web fonts can replace images of text. Decision tree
If your image fits none of the questions, the tree itself says it does not cover all cases. In that situation, fall back on the purpose of the image in its context.

Alt text for common situations
Informative images
When a photo or simple graphic carries meaning, write a brief description that conveys that meaning in the alt attribute, as the decision tree advises.
The draft adds a practical test: if a short piece of plain text would easily fit in the space the image occupies, use that text. For a PNG screenshot of a settings dialog, Settings dialog with the Export option highlighted tells the reader what they need.
Functional images: links, buttons and logos
When an image does something, describe its purpose and not the picture. The draft says to be direct, with examples such as Make Payment or W3C Logo.
For an image in a link or button that would be hard to understand without it, the decision tree says to communicate the destination of the link or action taken.
Images of text
If words appear only inside the PNG, the alt text should be the text on the image, according to the draft. That also covers special characters and emoticons, where a textual equivalent works.
If the same words already appear as real text nearby, the decision tree points to an empty alt instead, so nobody hears them twice.
Decorative images
A purely decorative image does not need a description. The draft says to use an empty value for the alt attribute.
Charts, tables and equations
Give these a short label in alt and present the full information elsewhere. The draft uses Maxwell’s Equations as an example of a short alternative.
For a graph or other complex information, the decision tree says to include the information contained in the image elsewhere on the page.
Length, markup and language limits
An alt value is plain text. Fragments of MathML or SVG cannot go inside it, and emphasis cannot be used, as the draft points out.
Text readers generally read the value out every time they meet it. The draft therefore warns against overly burdensome alternate text, even when it would fit in the space available.
Fit matters for sighted users too. If an image fails and the text does not fit the space reserved for it, some user agents will truncate it and others might not show it at all, per the same draft.
Because alt text is set on the img element and not in the file, the choice in png vs webp does not change how you write it. If you serve several versions of one picture, the guide to responsive images html covers the markup around it.
Mistakes to avoid
Most problems come from treating alt as a keyword box or a checkbox. Watch for these, all drawn from the guidance in the HTML alt techniques draft and the decision tree:
- Copying one description everywhere, when the same image may need different alt text in different contexts.
- Writing a paragraph where a short phrase would do.
- Trying to add markup or emphasis inside the attribute.
- Leaving out words that exist only inside the image.
- Describing a complex graph in alt instead of placing its information on the page.
Frequently asked questions
Does every PNG need alt text?
Show answer
Every image needs a decision, not a default. Informative and functional images get wording that carries their meaning or purpose, while a purely decorative one gets an empty value, per the draft.
How long should alt text be?
Show answer
Aim for something that would sit comfortably inside the area the picture fills. Anything longer belongs in the page text, where everyone can read it.
Can I reuse the same alt text for my logo on every page?
Show answer
Not automatically. Ask what the logo does on each page, such as naming the site or leading somewhere, and word the alt for that job, as the draft suggests.
Do search engines read alt text?
Show answer
Yes, the draft lists web search engines among the software that uses it. Write for people first and let that serve both audiences.
What if my image fits none of the cases?
Show answer
The decision tree admits it leaves some situations out. It points to its Image Concepts page for detailed guidance on text alternatives.



