The alt attribute is an HTML attribute used on image tags to provide a text description of the image. It serves both accessibility and SEO purposes by helping screen readers and search engines understand image content.
The alt attribute (written as alt="" in HTML img tags) provides alternative text that describes what an image depicts. It is displayed when an image cannot load, read aloud by screen readers for visually impaired users, and used by search engines to understand image content since they cannot "see" images the way humans do.
Alt attributes are a direct ranking factor for Google Image Search. Descriptive, keyword-relevant alt text helps your images rank in image search results and can drive significant traffic. Additionally, alt text is required for WCAG accessibility compliance, making it both an SEO and legal consideration.
Add the alt attribute to every img tag in your HTML. Write descriptive text that accurately conveys the image content and context. Include relevant keywords naturally when appropriate, but avoid keyword stuffing. For decorative images that add no informational value, use an empty alt attribute (alt="") to tell screen readers to skip them.
Want to learn more? Explore our SEO Glossary or check out our expert guides on SEO strategies.