Alt Attribute: What It Is, Why It Matters and How to Use It
The alt attribute is an HTML attribute used to provide a text alternative for an image. It is especially important for accessibility and can also help search engines understand the context and purpose of relevant images.
Alt Attribute vs Alt Text: What Is the Difference?
The terms are often used interchangeably, but technically they describe two slightly different things.
Alt Attribute
The alt attribute is the HTML attribute added to an
<img> element.
- Written as
alt=""inside an image tag - Defines where the alternative text is placed
- Can contain descriptive text or be intentionally empty
- Forms part of the HTML markup of the page
Alt Text
Alt text is the actual wording written inside the alt attribute to describe the image or its purpose.
- Describes meaningful image content or function
- Should reflect the surrounding page context
- Can be read by assistive technologies
- Should avoid unnecessary keyword stuffing
Technically, the attribute is the HTML component and the alt text is the value inside it. In practice, SEO tools and content teams frequently use both terms when discussing image descriptions.
Alt Attributes Support Accessibility, Context and Image SEO
The primary purpose of alternative text is accessibility, but relevant alt text can also provide additional context for search engines and improve the overall quality of image optimisation.
Accessibility
Useful alt text gives people using screen readers a text alternative when an image communicates meaningful information.
- Describe meaningful visual information
- Explain functional images where necessary
- Leave decorative images appropriately empty
Better Page Context
Alternative text can reinforce the relationship between an image and the surrounding page content when written naturally.
- Describe the actual image
- Reflect relevant page context
- Avoid generic file-style descriptions
Image SEO
Descriptive alternative text can help search engines interpret an image alongside filenames, captions and surrounding content.
- Use relevant descriptive wording
- Keep text concise and specific
- Avoid repetitive keyword stuffing
Write Alt Text for the Imageโs Purpose, Not Just for Search Engines
The best alt text communicates what a user needs to understand from the image in the context of the page. SEO relevance should come naturally from an accurate description rather than from inserting target keywords that do not meaningfully describe the image.
How to Write Good Alt Attributes
Good alt text is concise, accurate and written around what the image communicates in the context of the page.
Describe the Meaningful Content
Explain the important visual information rather than listing every insignificant detail visible in the image.
Consider the Page Context
The same image may need different alternative text depending on why it appears on that particular page.
Keep the Description Focused
Write enough to communicate the image purpose without turning the attribute into a long paragraph.
Use Keywords Only When Relevant
A relevant keyword can appear naturally when it genuinely describes the image, but it should never be forced.
Describe Functional Images by Purpose
For linked icons or buttons, explain the action or destination rather than describing only the visual appearance.
Leave Decorative Images Empty
Images that add no meaningful information can usually use an
empty attribute such as alt="".
Describe the Important Subject + Relevant Action or Context
A useful approach is to identify the main subject first, then add the detail a user needs to understand why the image matters. Avoid filler such as โimage ofโ or โpicture ofโ unless that wording is genuinely useful.
Good vs Bad Alt Attribute Examples
Strong alt text describes what matters. Weak alt text is vague, repetitive, stuffed with keywords or unnecessarily long.
Useful Alt Text
These examples describe the image clearly and provide useful context without over-optimising the wording.
Specific enough to identify the product without repeating unnecessary commercial keywords.
Describes the meaningful subject and activity naturally.
Communicates the central point rather than simply saying โSEO chartโ.
Weak Alt Text
These examples either provide almost no information or add wording primarily for search-engine manipulation.
Gives users and search engines almost no meaningful information.
Does not describe the image naturally and reads like a keyword list.
Uses redundant wording instead of explaining what is meaningful about the image.
Common Alt Attribute Mistakes
Most alt-text problems come from missing attributes, vague wording, keyword stuffing or treating every image in exactly the same way.
Missing Alt Attributes
Meaningful images without an alt attribute may provide no useful text alternative for users who cannot access the image.
Fix: add suitable alt text to meaningful images.Keyword Stuffing
Repeating target keywords inside alt text reduces clarity and does not improve the user experience.
Fix: describe the image naturally and specifically.Using the Same Alt Text Repeatedly
Different meaningful images should not automatically receive identical descriptions simply because they appear on one page.
Fix: describe the individual image and its specific context.Describing Decorative Images
Adding descriptive alt text to purely decorative graphics can create unnecessary noise for screen-reader users.
Fix: use an empty alt attribute where appropriate.Writing Excessively Long Descriptions
Alt text should communicate the useful information efficiently rather than reproducing a long paragraph.
Fix: keep only the information needed to understand the image.Ignoring Image Function
A clickable icon may need text describing the action or destination rather than the iconโs appearance.
Fix: describe the purpose when function matters more than appearance.Good Alt Text Is Written for Understanding First and SEO Second
The strongest approach is straightforward: describe meaningful images accurately, use an empty attribute for genuinely decorative images and allow relevant keywords to appear only when they are naturally part of the description.
Image SEO Best Practices Beyond the Alt Attribute
Alt attributes are important, but image optimisation also involves filenames, file size, page context, dimensions and the way images are delivered to users.
Use Descriptive Image Filenames
Rename useful images with clear, readable filenames where appropriate rather than relying on generic names such as IMG_4821.jpg.
Optimise Image File Size
Compress images and choose suitable formats so large files do not create unnecessary page weight or negatively affect loading performance.
Provide Relevant Surrounding Content
Headings, body copy and captions can help establish the context in which an image appears rather than relying on alt text alone.
Use Appropriate Image Dimensions
Serve images at dimensions suitable for their display area rather than forcing browsers to load unnecessarily oversized files.
Place Images Where They Add Value
Relevant images should support the subject of the surrounding section rather than being inserted solely as decorative SEO assets.
Review Alt Text in Context
Check whether each meaningful image has an appropriate text alternative and whether decorative images are handled correctly.
Treat the Alt Attribute as One Part of Complete Image Optimisation
Strong image SEO combines useful alternative text with sensible filenames, compressed files, appropriate dimensions and relevant surrounding content. This creates a better experience for users while giving search engines clearer contextual signals.
Common Questions About Alt Attributes
Quick answers to common questions about alt attributes, alt text, accessibility and image SEO.
01 What is an alt attribute in HTML?
An alt attribute is an attribute used within an HTML
image element to provide a text alternative for the
image. It is written in the form
alt="description".
02 Is an alt attribute the same as alt text?
Not technically. The alt attribute is the HTML attribute, while alt text is the text value placed inside it. However, the terms are commonly used interchangeably in everyday SEO discussions.
03 Does alt text help SEO?
Descriptive alt text can provide useful context about an image and support image optimisation. Its primary purpose, however, should be to provide an appropriate text alternative rather than to insert SEO keywords.
04 Should every image have alt text?
Not every image needs descriptive alt text. Meaningful
images generally need an appropriate text alternative,
while purely decorative images can often use an empty
alt attribute such as alt="".
05 How long should alt text be?
There is no universal ideal character count for every image. Alt text should be concise enough to avoid unnecessary detail while still communicating the meaningful information required in context.
06 Should I put keywords in alt attributes?
A relevant keyword can appear when it naturally describes the image. Avoid inserting keywords purely for rankings or repeating several keyword variations inside one alt attribute.
07 What does an empty alt attribute mean?
An empty alt attribute is written as
alt="". It is commonly used when an image is
decorative and does not communicate information that
needs a text alternative.
08 Can missing alt attributes affect accessibility?
Yes. When a meaningful image lacks an appropriate text alternative, people using assistive technologies may miss information communicated visually by that image.
Build Stronger On-Page SEO Across Your Website
Alt attributes are one small but useful part of website optimisation. If you want to identify broader opportunities across content, metadata, internal linking, technical SEO and page structure, explore our SEO audit and on-page SEO services.