Most alt text advice is written for blog photos. "A golden retriever catching a frisbee on a beach." Fine. But try that on a product page for a hardware store and it falls apart fast, because half the catalog is grey metal on a white background.
A 1/2" brass elbow and a 3/4" brass elbow look identical in a photo. So do most drywall anchors. If the alt text just says "brass fitting", a screen reader user gets nothing the sighted user didn't already get from the title, and a sighted user at least sees the scale in the second photo.
Here's how I think about it now, after rewriting a lot of these.
Start with what the image is for, not what's in it
Alt text answers one question: if this image didn't load, what would the reader miss?
On a product page, the images usually do one of these jobs:
- Identify the product. The main photo. The title right next to it already says what it is.
- Show a detail you can't get from text. The thread type, the connector end, the back of the packaging, how the clip locks.
- Show scale or use. The part in someone's hand, installed under a sink, next to a ruler.
- Decoration. A lifestyle background, a repeated brand banner.
Each job gets different alt text.
The main photo: don't repeat the title word for word
If the <h1> says "Digital Multimeter, Auto-Range" and the alt says "Digital Multimeter, Auto-Range", a screen reader reads the same thing twice in a row. Not harmful, just noisy.
Better: add what the photo shows that the title doesn't.
<!-- meh -->
<img src="multimeter.webp" alt="Digital multimeter">
<!-- better -->
<img src="multimeter.webp"
alt="Digital multimeter, front view with rotary dial and red and black test leads">
Colour, what's included in the box, which side you're looking at. Short, factual.
Detail shots are where alt text actually earns its place
This is the image people zoom into. It's also the one most often left as alt="product image 3".
If the second photo exists to show that the fitting has a male thread on one side and a compression end on the other, say exactly that:
<img src="elbow-detail.webp"
alt="Close-up of the elbow: male thread on one end, compression nut on the other">
That sentence is useful to everyone, including the person on a slow connection whose images haven't loaded yet. It also tends to be the information people search for, which doesn't hurt.
Scale photos: give the size in words
"Anchor held between two fingers" is better than nothing, but the real info is the size. If the product has a length or a diameter, put it in:
<img src="anchor-hand.webp"
alt="Plastic wall anchor held between two fingers, about the length of a fingertip">
Only state a measurement if it's actually in the product data. Guessing "approx. 3 cm" from a photo is how wrong information ends up on a page.
Decorative images get an empty alt, not a missing one
<img src="banner-texture.webp" alt="">
alt="" tells assistive tech to skip it. Leaving the attribute out entirely is different: some screen readers will then read the file name, and nobody wants to hear "banner underscore texture underscore final two dot webp".
Galleries and thumbnails
Thumbnail strips are a common trap. Five thumbnails, each with the same alt as its large version, means the page announces everything twice.
Two options that both work:
- Make the thumbnails buttons with a label like "Show image 2 of 5: close-up of thread", and give the image inside
alt="". - Or keep the alt on the thumbnail and make the big preview the decorative one, if it only mirrors the selected thumb.
Pick one. The bug is doing both.
<button type="button" aria-label="Show image 2 of 5: close-up of thread"
aria-pressed="false">
<img src="thumb-2.webp" alt="">
</button>
Generating alt text from product data
On a big catalog nobody hand-writes 5,000 alt texts. A template from structured fields is a decent baseline:
function mainAlt(p: { name: string; color?: string; view?: string }) {
return [p.name, p.color, p.view].filter(Boolean).join(', ');
}
It's not great prose, but it's honest and it scales. Then spend human time on the detail shots, because a template can't know that photo 3 exists to show the locking clip.
A few things I'd avoid in generated alt text:
- "Image of" / "Photo of". Screen readers already announce it's an image.
- Keyword lists. "Multimeter tester voltmeter electrical tool best price" helps nobody and reads like spam.
- Prices and stock status. They change; the alt text usually doesn't get updated with them.
A quick check you can run today
Open a product page, turn off images (or run a screen reader for two minutes), and try to answer: what is this, what does it connect to, how big is it? If you can't, the alt text is where the fix goes.
On RAMO, the hardware store I work on, the categories where this mattered most were the "everything looks alike" ones, like screws and anchors and pipe fittings. If your catalog has a section like that, start there.
Top comments (0)