Web Development

How to Write Alt Text for Website Images: The Decision Tree, Examples and the Mistakes That Hurt

By Asad Ali ·

Good alt text starts with a decision: decorative images are marked decorative, informative images are described plainly, linked images name their destination, and charts are summarised with their data nearby. Worked rewrites and a 40-image audit show the method.

17 min readLast updated

How to write alt text for website images with a decision tree examples and common mistakes

To write good alt text, decide what the image is for before you write a word: if it carries information, describe that information in plain words; if it is a link or button, describe where it goes or what it does; if it is purely decorative, mark it decorative so it is skipped; and if it is a chart, summarise the finding and put the data nearby. That decision tree, applied image by image, is the whole method in this guide.

Alt text is the written alternative to an image. It lives in the image code or in the image settings in your content system, and most visitors never see it — which is precisely why it is so often neglected, pasted in at the last minute, or filled with whatever the file happened to be called. Yet for a significant group of readers it is the image. Writing it well is not a favour or a ranking trick. It is part of publishing the page properly, in the same way that checking a link works is part of publishing it properly. This guide gives you a repeatable way to do it: a decision tree, honest length guidance, worked rewrites you can copy the pattern from, and a simple workflow for keeping new images right as they are added.

What alt text is, and who actually uses it

Three groups of readers rely on alt text, and picturing them makes the writing decisions much easier. The first group uses screen readers: software that reads a page aloud, or presents it in braille, for people who are blind or have low vision. When the reader reaches an image, it reads the alt text in place of the picture, in the flow of the surrounding sentences. Alt text that reads like a file name, a list of search phrases or a caption repeated word for word breaks that flow and wastes the listener time. The second group is anyone for whom the image does not load: a slow connection, a broken file, a blocked image in an email or a browser setting that saves data. Many browsers show the alt text in the empty space where the image should be, so it works as a stand-in label that keeps the page understandable. The third group is search engines, which cannot interpret a photograph the way a person can and use the alt text, the file name and the surrounding copy together to understand what an image shows. That third use is real, but it comes last in priority. Write for the first two groups and the third is served automatically; reverse the order and nobody is served well.

Alt text is not the same as a caption, and the difference matters. A caption is visible to everyone, sits under the image, and often adds context, credit or a comment the author wants all readers to have. Alt text is the replacement for the image itself. If a caption already says everything the image shows, the alt text can be brief, but it should still identify what the image is, because a screen reader user hears the alt text where the image sits, not as part of the caption. Nor is alt text the place for a sales pitch, a credit line or a joke that only makes sense if you can see the picture. Keep each field doing its own job and the page reads cleanly for everyone.

The decision tree: four kinds of image, four different answers

Before writing, place every image in one of four groups. Decorative images add mood or texture but no information: a background pattern, a soft-focus stock photo beside a heading, a divider flourish. If you removed them, the page would lose nothing a reader needs to know. These should be marked decorative, which in practice means an empty alt value, so assistive technology passes over them in silence. Describing them — a long sentence about a smiling team in an office the reader is not being told anything about — only adds noise. Informative images carry content: product photos, screenshots, photos of a finished job, a venue, a person being quoted. These need real alt text that conveys what the image contributes, in the context of that page. Functional images are images that do something: a logo that links home, a search icon button, a product thumbnail that opens a larger view, a social icon. Their alt text should describe the action or destination, not the picture — the home page, search, or the name of the product — because that is what the reader is choosing. Complex images — charts, diagrams, maps, infographics — carry more than a sentence can hold. Give them a short alt text that names the chart and its main finding, then provide the full information nearby: a data table, a written summary, or a linked longer description. A chart whose only existence is inside an image is a chart many readers simply never receive.

  1. Ask what would be lost if the image vanished. If the honest answer is nothing but decoration, mark it decorative and move on.
  2. Ask whether the image is a control. If clicking it does something, write the action or destination as the alt text.
  3. Ask whether a sentence can carry it. Most photographs and screenshots fit in one plain sentence that names the subject, the relevant detail and the context the page needs.
  4. Ask whether it is data in picture form. Charts and diagrams need a summary in the alt text plus the underlying information in text or table form beside them.

Work through those four questions in order and the writing almost does itself, because each answer tells you the shape of the text. Most alt text problems are really sorting problems: decorative images lovingly described, functional images labelled with what they depict instead of what they do, and charts given a title instead of a meaning. Sort first, write second. Our wider guide to a website accessibility checklist places this work alongside headings, contrast, keyboard use and form labels, which together decide whether a page is genuinely usable or merely presentable.

Length: a working habit, not a law

You will find confident character limits quoted in articles about alt text. Treat them as habits from particular tools or house styles, not as rules of the web. There is no universal maximum length written into how alt text works, and a screen reader will read a longer description if one is supplied. The practical guidance is about usefulness, not counting. Keep ordinary images to a short sentence or less, because that is all they need and because a listener hears alt text inline, between the sentences before and after it. A photograph of a blue running shoe in a shop listing needs the colour, the angle and any feature the buyer is being shown — not the laces described eyelet by eyelet. Save length for the images that earn it: a group photo where the point is who is present, a before-and-after pair where the change is the story, a screenshot where the setting on screen is the lesson. If you find yourself writing a paragraph, that is a signal the information belongs in the visible copy or a table as well, with the alt text acting as a summary and a signpost to it. Short is a good default. Complete is the actual standard.

Worked rewrites: five images, before and after

The table below rewrites the alt text for five common images. The before versions are the kinds of entries found again and again in real audits: file names, empty generalities, keyword lists and descriptions of things that should have been skipped. The after versions are not clever. They are simply written for a listener standing in that spot on the page.

ImageBeforeAfterWhy the rewrite works
Product photo: a blue running shoe, side view, in an online storeIMG_4821.jpgBlue mesh running shoe with white sole, side view showing the cushioned heelNames the product, the colour and the feature the photo exists to show
Team photo on an about page: three named staff members outside the workshopOur amazing teamWorkshop manager Priya Shah, fitter Tom Ellis and apprentice Ana Ruiz standing outside the Leeds workshopGives the names a sighted reader gets from the caption and the faces, without praise language
Chart in a guide: a bar chart of the worked audit later in this articleChart SEO image graphBar chart of a 40-image page audit: 14 images had no alt text, 9 used the file name, 6 decorative images were not marked decorative, and 11 had good descriptive alt textStates the finding and the figures instead of naming the chart type
Decorative texture: a faint marble background behind a headingPale grey marble texture with soft white veins, high resolution background imageMarked decorative: empty alt text, so the image is skippedRemoves a pointless interruption from the listening experience
Linked logo in the page header, linking to the home pageCompany logo blue and orange mountain shapeAsad Webs — homeDescribes the destination the image leads to, which is what a reader choosing the link needs

Read the after column aloud in sequence and a second lesson appears: none of them begins with the words image of or photograph of. The reader software already announces that an image is present, so those openings waste the first words of every description. Start with the subject itself. The same discipline helps images load and present better in the first place; our guide to compressing images without losing quality and our notes on speeding up a WordPress website cover the file side of the same housekeeping, and the free image compressor handles the resizing and compression step before upload.

Worked example: an audit of alt text on one 40-image page — hover or tap each bar for details.

Missing alt textMissing alt text: 14 of the 40 images in this worked example had no alt text at all14Filename pasted as altFilename pasted as alt text: 9 of the 40 images in this worked example used the image filename as the alt text9Decorative unmarkedDecorative image not marked decorative: 6 of the 40 images in this worked example were decorative images with descriptive alt text they did not need6Good descriptive altGood descriptive alt text: 11 of the 40 images in this worked example already had useful, descriptive alt text11

The chart above is a worked example, not a survey: it shows the findings from auditing one fictional-but-typical 40-image page, built for this guide so you can see how the sorting works in practice. Of the 40 images, 14 had no alt text at all, 9 simply repeated the image file name, 6 were decorative images carrying descriptions they should never have had, and 11 already had good descriptive alt text. In other words, nearly three quarters of the page needed attention, and most of the fixes took seconds each once the images were sorted. Run the same count on one of your own key pages — a home page, a best-selling product page, a services page — and use your own figures in place of these. The value is in the sorting exercise, not in copying the proportions.

The keyword-stuffing warning: write for people

Because search engines read alt text, a persistent temptation is to fill it with phrases people might search for: a shoe described with a string of buying terms, a hotel photo followed by a list of nearby attractions, every image on a page repeating the same commercial phrase. Resist it completely. Stuffed alt text fails on every level at once. For the listener, it is gibberish delivered in the middle of a sentence they were following. For the search engine, a field that reads as manipulation can be discounted or treated as a spam signal rather than a help. And for the business, it signals that the page was written for an algorithm instead of a customer, which careful readers notice even when they can see the images. The honest rule is simple: if a phrase belongs in the alt text, it belongs because it describes the image in its context. A blue running shoe can be described as a blue running shoe wherever it appears. Turning that description into a list of every shoe phrase you would like to rank for is not description any more, and everyone involved — listener, search engine and customer — can tell the difference.

File names are not alt text

File names and alt text are cousins, not substitutes, and confusing them causes two of the commonest audit findings: the file name pasted into the alt field, and a good alt sentence used as a file name full of spaces and punctuation. A file name is an organisational label. A clear, hyphenated name such as blue-running-shoe-side-view.jpg helps you find the file, helps a developer understand a folder, and gives search engines a small supporting clue. An alt text entry is a sentence for a reader, with spaces, normal punctuation and only the detail the page needs. Keep both, do each properly, and never copy one into the other and call the job done. While you are in the image library, it is also worth knowing what else a file carries: photos can contain embedded location and device details, and our free EXIF viewer, editor and remover lets you inspect and clean that data before an image is published — useful for staff and customer photos in particular. Photographers preparing shop imagery will also find the workflow in our online store product photo guide helpful, since alt text is far easier to write for a photo that was taken with a clear purpose.

A simple CMS workflow that keeps alt text right

Most content systems, including WordPress and the common shop platforms, give every uploaded image an alt text field — the discipline is filling it at upload, not in a yearly rescue project. Adopt a four-step habit. First, rename the file before upload using the descriptive hyphenated pattern above, so the library stays searchable. Second, write the alt text while the page context is in front of you, using the decision tree: decorative, informative, functional or complex. Never write alt text from the media library alone weeks later, because the context that decides the wording will be gone. Third, leave the caption and title fields to do their own jobs rather than pasting the same sentence into every field the system offers; duplicated text is read out repeatedly by some tools and helps nobody. Fourth, review in batches: once a quarter, sort the media library or run a page-by-page check on your most visited pages, fix the missing and pasted entries, and note which kinds of page keep producing them. New templates, new staff and new product ranges are where alt text quietly degrades, and a short recurring check catches the drift while it is still a ten-minute job.

Five mistakes that hurt more than they help

  • Leaving the field empty on informative images. Silence where information should be is the single biggest failure. If a product photo matters enough to publish, it matters enough to describe.
  • Describing decorative images in loving detail. Every unnecessary description is an interruption a listener must sit through to reach the content they came for. Mark decorative images decorative.
  • Starting every entry the same way. A page where twenty images each begin with the same opening phrase trains listeners to tune out — and the descriptions themselves usually turn out to be near-duplicates too.
  • Writing the alt text for a different page. The same venue photo needs one description in a wedding gallery and another in an accessibility information page, where the ramp in the corner is the point. Context decides the wording.
  • Treating the job as finished at launch. Alt text rots as pages are edited and images are swapped without their text being revisited. The image changes, the description of the old image stays, and the result is worse than nothing: confident misinformation.

Conclusion: sort first, then write one honest sentence

Good alt text is not a specialist skill. Sort each image — decorative, informative, functional or complex — write the plain sentence that group calls for, keep file names and alt text doing their separate jobs, and fill the field in at upload rather than in a rescue project. Start with your most visited page, count what you find the way the worked example in this guide does, and fix that page completely before moving on. A page finished properly teaches you the habit faster than a site half-fixed everywhere.

Want your product and service pages checked image by image? Book a free consultation with Asad Webs — tell us which pages matter most and we will reply with honest next steps for fixing missing, pasted and decorative alt text, with no obligation.

Frequently Asked Questions

What should alt text say, in one sentence?

It should say, in plain words, what a reader who cannot see the image would need from that image in that place on the page: the information, the action, or nothing at all if the image is purely decorative. If you can swap the sentence in for the image and the page still makes sense, the alt text is doing its job.

How long should alt text be?

As long as the image needs and no longer. A simple product photo may need six to twelve words; a chart may need a short summary plus a fuller description in the surrounding text or a linked data table. Treat any character figure you read online as a working habit, not a rule, and never cut a needed detail just to hit an arbitrary count.

What is the difference between alt text and a file name?

A file name is the label your system stores the image under, such as blue-running-shoe-side-view.jpg. Alt text is a separate field written for readers, stored in the image tag or your content system, and read aloud by screen readers. Good file names help you organise a library; alt text helps a person understand a page. One cannot substitute for the other.

Should decorative images have empty alt text or no alt text?

In HTML terms they should carry an empty alt attribute — alt with nothing between the quotes — or be marked decorative in your content system, so assistive technology skips them cleanly. Leaving the attribute out entirely is different: some tools will then read the file name aloud, which is exactly the interruption you were trying to avoid.

Can I write the same alt text for similar images?

Only if the images genuinely do the same job in the same context, which is rarer than it looks. Two photos of the same shoe from different angles show different things, and two headshots are different people. Near-duplicate alt text across a gallery helps nobody listening to the page, so describe what is specific to each image.

Does alt text help search rankings?

Clear alt text can help a search engine understand what an image shows, and it can help an image appear in image search for relevant queries. That is a side benefit of writing for people, not a reason to load the field with search phrases. An alt field written to please an algorithm usually reads badly to the person it exists for, and it can be treated as spammy practice.

Who should write alt text — the photographer, the writer or the person uploading?

The person who knows why the image is on the page, which is usually the person writing or assembling that page. Photographers can supply accurate notes about what a photo shows, and developers can make sure the field is present and easy to fill, but the final wording needs the page context: the same photo needs different alt text in a product listing, a news story and a tutorial.

Category: Web Development

Tags: SEO · website planning

About Asad Ali

Asad Ali is a website developer and SEO expert specialising in local SEO, and the founder of Asad Webs. He has over 20 years of experience — he began in graphics design in 2003 — and he builds the free online tools on this site, develops websites for clients, and writes the guides published here.

LinkedIn Facebook Website
KEEP READING

Next guide

How to Create a Lead Magnet for Your Website: Formats, Honest Maths and the Follow-Up That Matters →

Related articles

Join the conversation

No account needed. Comments appear only after approval. Your email address will not be published.

Be the first to share a useful question or thought.

You won’t be subscribed to any mailing list.
WELCOME BACK

Sign in

Access your orders, saved products and account.