Heading Tags

May 22, 2026

Anchor Text

May 25, 2026

Alt Text

Alt text (short for “alternative text”) is a written description added to an image in the HTML code of a webpage. It serves three primary purposes: it tells search engines what an image is about, it appears in place of the image when the file fails to load, and it allows screen readers to describe visuals to users with visual impairments.

In HTML, alt text is added through the alt attribute of the <img> tag:

<img src="puppy.jpg" alt="Golden retriever puppy playing with a green ball on green grass">
Golden retriever puppy playing with a green ball on green grass

Best Practices for Writing Alt Text

  1. Be descriptive but concise. Aim for roughly 100–125 characters. Long enough to be specific, short enough that screen readers don’t drag.
  2. Describe what’s actually in the image, not what you wish it conveyed. Avoid generic labels like “image1.jpg” or “photo.”
  3. Include the target keyword naturally – but only if it genuinely fits the image. Forcing keywords is keyword stuffing and gets penalized.
  4. Don’t start with “Image of…” or “Picture of…” – screen readers already announce that it’s an image.
  5. Provide context relevant to the surrounding content. The same photo can warrant different alt text on different pages depending on what the article is about.
  6. Use empty alt (alt="") for decorative images like dividers, background patterns, or icons that add nothing to comprehension. This tells screen readers to skip them.
  7. Don’t keyword-stuff. “puppy dog cute pet golden retriever puppy for sale buy puppy” is a red flag to Google and useless to a blind user.
  8. For product images, include attributes that matter (color, model, size, brand) – this is where Google Images traffic converts into sales.

Good Alt Text Examples

Using the image above of a golden retriever puppy playing with a ball, here’s how alt text would be written at three quality levels:

Bad alt text (useless):

<img src="dog.jpg" alt="dog">

Bad alt text (keyword-stuffed):

<img src="dog.jpg" alt="puppy dog golden retriever puppy cute puppy buy puppy pet dog ball toy">

Good alt text (SEO best practice):

<img src="golden-retriever-puppy-ball.jpg" 
     alt="Golden retriever puppy playing with a ball outdoors on a sunny day">

The good version is descriptive, concise (about 75 characters), reads naturally, contains the relevant primary keyword (“golden retriever puppy”) without forcing it, and accurately reflects what’s in the image. A screen reader would announce it cleanly, Google can map it to image-search queries like “golden retriever puppy playing,” and if the image fails to load, the user still understands what was meant to be there.