What Is the alt Attribute? SEO Benefits, Best Practices, and Examples Explained

June 25, 2026

Author: Shusaku Yosa
alt属性とは?SEO効果と正しい書き方・記述例をわかりやすく解説

The "alt" notation you see when writing HTML for images. Many people include it without quite knowing what it is for, whether it helps SEO, or how to use it properly. The alt attribute is an important element for correctly conveying the content of an image to search engines and users. This article clearly explains what the alt attribute is, from the basics through its SEO benefits, the correct way to write it with examples, and common mistakes.

What Is the alt Attribute?

The alt attribute is text information written in an HTML img tag that describes the content of an image. "alt" is short for "alternative," and as the name suggests, it refers to descriptive text that stands in for the image itself. It plays the role of being displayed in place of the image when the image cannot be shown, and of conveying the image's content to search engines and screen-reader software.

Basic Way to Write the alt Attribute

The alt attribute is written inside the img tag in the form alt="description of the image." For example, for a product photo of a blue sneaker, you would write something like alt="product photo of a blue running shoe," describing what the image shows in concise text. It is common to write it as a basic element of the img tag alongside the src attribute, which specifies the image's file name or URL.

Three Situations Where the alt Attribute Matters

The alt attribute is useful mainly in the following three situations.

  1. When the image cannot load: if the image fails to display due to a connection error or a file problem, the content is shown as alternative text
  2. When conveying to search engines: it tells crawlers, which cannot understand the contents of an image, what the image depicts in text
  3. When using screen readers: it conveys the image's content by voice to visually impaired users browsing with a screen reader

SEO Benefits of the alt Attribute

When set appropriately, the alt attribute also works in your favor for SEO. Because search engines cannot recognize the content of an image the way humans do, they use the alt attribute text as a clue to judge what the image represents. Here we look at the benefits the alt attribute brings to SEO.

Drives Traffic from Image Search

In Google Image Search, the alt attribute text is an important element for judging the content of an image. Setting an appropriate alt attribute makes your image more likely to appear to users searching with related keywords, and you can expect traffic via image search. The effect is especially large for visually searchable content such as product images and diagrams.

Helps Convey Page Content

The alt attribute also helps search engines understand the overall theme and context of a page. When the body content and the image's alt attribute are consistent, it becomes easier to convey to search engines what topic the page covers. This indirectly contributes to evaluation in regular search results as well.

Improved Accessibility Supports Evaluation

The alt attribute is also an element that improves accessibility (the state in which anyone can access information). Building a site that is easy for all users to use aligns with the user-first approach that Google values. Setting alt attributes carefully is an effort that raises the quality of the site itself, not just something done for SEO.

How to Write the alt Attribute Correctly

It is not enough to simply set an alt attribute. To increase its effectiveness, it is important to write it with a few key points in mind.

  1. Describe the content of the image specifically and concisely
  2. Include relevant keywords in a natural way
  3. Keep it from being too long, at a length that conveys the key point
  4. Leave the alt attribute empty for decorative images

Describe the Image Content Specifically

In the alt attribute, write specifically what the image represents. Rather than vague words like "photo" or "image," aim for a description that conveys the content as it appears, such as "coffee in a white ceramic mug." Whether a person who cannot see the image can picture the content when reading it is a good benchmark for a quality alt attribute.

Include Keywords Naturally

Including relevant keywords with SEO in mind is effective, but the premise is to use them naturally within a sentence that describes the image's content. Listing keywords or stuffing in words unrelated to the image can instead become a cause of lower evaluation. Aim for a natural sentence that satisfies both "describing the image" and "including keywords."

Use an Empty alt Attribute for Decorative Images

For images that carry no meaning as content, such as divider lines, backgrounds, and decorative icons, set alt="" (an empty alt attribute). Doing so lets screen readers skip unnecessary images and avoids hindering the user's browsing experience. Rather than omitting the alt attribute itself, it is recommended to write it even when it is empty.

alt Attribute Examples

Let's compare specific examples with good and bad versions.

Good Examples

  • Product photo: alt="red leather shoulder bag (front view)"
  • Graph: alt="bar graph showing monthly sales trends in 2025"
  • Decorative image: alt="" (leave empty)

Examples to Avoid

  • Too vague: alt="image" / alt="photo 1"
  • Keyword stuffing: alt="bag leather cheap online recommended popular sale"
  • Leaving the file name as is: alt="IMG_0234.jpg"

Common Mistakes with the alt Attribute

If you set the alt attribute the wrong way, it can fail to deliver SEO benefits and may even work against you. Representative mistakes include putting the same keyword in every image, stuffing in unrelated keywords, and leaving the alt attribute empty for images that actually need a description. The purpose of the alt attribute is always to "accurately convey the content of the image," so avoid uses that stray from that principle.

Summary

The alt attribute is alternative text for conveying the content of an image to search engines and users. When set appropriately, it offers benefits on both the SEO and user-experience fronts, including traffic from image search, better understanding of page content, and improved accessibility. The key points are to describe the image's content specifically and concisely, include relevant keywords naturally, and leave decorative images empty. It is not a difficult technique; the steady accumulation of careful descriptions for each image raises the quality and evaluation of your site as a whole.

Related posts