Alternative text is text associated with an image that serves the same purpose and conveys the same essential information as the image. In situations where the image is not available to the reader, perhaps because they have turned off images in their web browser or are using a screen reader due to a visual impairment, the alternative text ensures that no information or functionality is lost. Absent or unhelpful alternative text can be a source of frustration for visually impaired users of the Web.
[[File:Jacques-Louis David 017.jpg |thumb |upright=0.75 |alt=Painting of Napoleon Bonaparte in His Study at the Tuileries |''[[The Emperor Napoleon in His Study at the Tuileries]]'' by [[Jacques-Louis David]]]]
The alt
parameter text ("Painting of Napoleon Bonaparte in His Study at the Tuileries") is not normally visible to readers; however, it may be displayed by web browsers when images are switched off, or read out loud by screen readers for those with visual impairment, and can be used by search engines to determine the content of the image. In keeping with other Internet guidelines, the term "alt
text" (in a code
font) is used here to refer to the text supplied for the image alt
parameter and which generates text for the HTML alt attribute; the term "alternative text" refers to the text equivalent for an image, regardless of where that text resides.
An image that is purely decorative (provides no information and serves only an aesthetic purpose) requires no alternative text. Often the caption fully meets the requirements for alternative text. However, the only situation where blank alt
text is acceptable is where such images are unlinked, which is rarely possible. One solution is to provide something at least minimally useful such as |alt=photograph
, |alt=painting
, or |alt=sculpture
. Another solution, if the caption doesn't already describe or identify the image, is for the alt
text to do so as briefly as possible.
The audience for alternative text includes:
Alternative text should be short, such as "A basketball player" or "Tony Blair shakes hands with George W. Bush". If it needs to be longer, the important details should appear in the first few words, allowing the user of a screen reader to skip forward once the key points are understood. Very long descriptions can be left for the body of the article. does not support HTML's longdesc attribute. All readers will be aware this element is an image, so adding "photograph of" isn't usually necessary.