SEO

Alt text

Alt text is a concise written description embedded in Hypertext Markup Language image tags that screen readers read aloud to visually impaired users and search engines process to understand image content.

also called: alt attribute, alternative text, image alt text

// definition

Alt text, short for alternative text, is an attribute added to an HTML image tag that provides a textual description of a visual element on a web page. It is rendered in place of an image if the image file fails to load due to network errors or broken file paths. Screen readers use alt text to announce visual content to visually impaired visitors.

Search engines use alt text during crawling and indexing to interpret the subject matter of an image, which helps determine rankings in image search results. Unlike image captions, which are visible to all users beneath an image, alt text remains hidden in the underlying code unless an image fails to display. It also differs from image title tags, which typically appear as pop-up tooltips when a user hovers over an image.

// why it matters

Adding descriptive alt text improves website accessibility by making digital content readable for users who rely on assistive technologies. This helps organizations maintain compliance with web accessibility standards and avoid legal risks related to discrimination. From a search engine perspective, relevant alt text provides contextual signals that allow search engine bots to index images accurately. As a result, pages gain visibility in target search queries and image search feeds, driving organic web traffic from users seeking visual information.

// example

An e-commerce website displays a product photo of a blue leather wallet. In the Hypertext Markup Language code, the image tag includes the attribute alt="Folded navy blue leather bi-fold wallet with card slots". When a visually impaired user visits the page, their screen reader speaks this description. If the image fails to load, the browser displays this text instead of a blank box.

Questions and Answers

How long should alt text be?
Alt text should generally be under one hundred and twenty-five characters to ensure compatibility with screen readers. Direct, concise descriptions allow assistive tools to read the text efficiently without truncating the message. Writers should focus on essential visual details and avoid redundant phrases like image of or picture of.
Does every image on a website need alt text?
No, decorative images that do not convey meaningful information should have empty alt attributes. Leaving the alt tag empty signals to screen readers to skip the element entirely, preventing unnecessary distractions for visually impaired users. However, informative images, diagrams, and navigational icons always require accurate alternative text.
How does alt text help with search engine optimization?
Alt text provides search engine crawlers with text-based context about the subject matter of an image. Search engines cannot interpret raw pixel data visually, so they rely on alternative text to understand and index images. Including relevant keywords in alt text helps pages rank higher in image and web search results.