Massachusetts State Seal

An official website of the Commonwealth of Massachusetts Here's how you know

Official websites use .mass.gov

A .mass.gov website belongs to an official government organization in Massachusetts.

Secure websites use HTTPS

A lock icon or https:// means you've safely connected to the official website. Share sensitive information only on official, secure websites.

Fundamentals: Alternative text

Text alternatives are needed for non-text media to make the media accessible. For images, this is called alternative text, or alt text for short. Alt text can be added to images just about anywhere they exist digitally. Find out how to write alt text, and add it to images in documents, Mass.gov, and HTML.

You can view this in single page view, that provides all content at once for reference, or you can view this page in guided view, which breaks the content down into sections so you can focus on one part at a time.

Alt text for images

While they say a picture is worth a thousand words, if you can't see the image, it's only as good as its text alternative (alt text). Alt text can be added to an image in Office documents, PDFs, Mass.gov, emails, social media, and HTML.

When a screen reader user navigates to an image, the screen reader software will announce the description provided in the alt text. If you do not provide alt text, it will instead announce the image file name, which is unhelpful. It's important that every meaningful image has alt text. What that alt text is might be different depending on the purpose of the image.

How to write alt text

Alt text should always be descriptive and brief. A maximum of two sentences is recommended, or around 125 characters. It is also good to include sentence punctuation while writing alt text, so that the screen reader will pause at commas and periods. While plain text on the page can be navigated at any speed with a screen reader – by character, word, sentence, paragraph – alt text is announced all at once and is not able to be navigated. This is why want want to keep our description brief, and also why we avoid images of text – it is often far too much to include in alt text. We'll discuss more about images of text later in this guide.

When writing alt text, it can be helpful to ask yourself four questions:

  • Does the image tell a story that is related to my content?
  • Is the image literal and necessary to understand my content?
  • Is the image functional?
  • Does the image have any meaning at all?

If an image tells a story, it makes sense to write alt text in that context, where you describe the image concept instead of the specific contents. If an image is a screenshot in a tutorial, the alt text should be more literal and exact. If the image is functional like an icon, then it's better to describe its function rather than how it looks. And if an image is simply decorative, it should be marked that way. Let's review a few examples.

Literal or functional images

Images that are literal might be a screenshot added to instructions. This kind of image would need alt text that highlights the specific purpose of the image. Not every detail in the image needs to be conveyed in the alt text, just the image’s purpose. Similarly, a functional image, like an selectable icon button, would have alt text that calls out the function or destination when selected. Following are some examples of literal and functional images.

Facebook, Instagram, X and LinkedIn icons below a heading that reads Follow us on social media.
These social media icons are functional. Alt text would be the name of the social media platform it links to.
The Mass.gov home page, the Working menu expanded, with the Unemployment link highlighted.
This screenshot highlights a link to show a user what to select. Alt text would be "The Mass.gov home page, Working menu expanded, with the Unemployment link highlighted."
A silver USB flash drive.
This image of a flash drive is very plain, and doesn't require much for alt text. "A silver USB flash drive" is appropriate alt text.

Images that tell a story

Images are used as a way to help your audience connect more with your content. It is important that we convey the actions or emotions present in these images through alt text. It is also important that we are inclusive with alt text. Images of people will almost never be decorative and always require alt text. Alt text for these kinds of images will always be a judgement call, based on why you chose the image for that context. If an image is of a specific person, it might describe that specific person, or it may describe the action or emotion that person is expressing in the image. Following are some examples of images that tell a story.

Snow drifts over a highway in winter framed on either side by snow covered hills and barren trees.
This image may seem decorative, but it brings to mind travel in the winter. Alt text might be "Snow drifts over a highway in winter framed on either side by snow covered hills and barren trees."
A woman who is blind listens as she navigates her phone using a screen reader.
This image might be used on a page about the accessibility of your content. The alt text for this might be "A woman who is blind listens as she navigates her phone using a screen reader."
A diverse group of office workers collaborate on a report together at a desk.
An image like this might be used on a careers page, and would have alt text like "A diverse group of office workers collaborate on a report together at a desk."

Decorative Images

While it's possible to mark images as decorative, it is not often the right way to go. Most of the time, if you include an illustration or photo, you are doing it for a reason besides decoration. Plan to write text for all images like this.

If the graphic is simply a shape, texture, flourish, pattern or background, then that is likely the appropriate time to mark it as decorative. If text exists with the image that would make alt text redundant, such as a phone icon next to a phone number, that is also a time when an image should be marked as decorative.

A faint illustration of a lighthouse behind a My Mass Gov login box.
This faint illustration of a lighthouse does not provide context for logging in to MyMassGov. This type of image is just a background to fill space, and can be marked as decorative.
The text Forestry Report over a image of tree tops against the sky.
An image like this may be decorative or not. In this case, on a general forestry report, this generic image of trees does not add additional context and can be marked as decorative. However, if images of a specific forest are included to highlight features of that area, then those images would not be decorative.
Contact information of phone, email and chat on a webpage. Icons of a phone, letter and chat bubble appear next to the text.
These icons are redundant with the text on the screen. To prevent a screen reader from announcing things twice such as "image phone, phone," or "image email, email," we mark these redundant icons as decorative.

Images of text

Images of text should be avoided. Sometimes, like with social media or logos, this is unavoidable. A logo is an exception to this rule, where changing the image to plain text would cause it to lose meaning. On social media platforms, it's important to include the text that would be in the image in the post as well. Find out more in our Social Media Accessibility guide.

Images of text or tables cannot be accessed with a screen reader, and the content within them will typically be far too much to keep to two sentences in alt text. Make sure that you replace images of text with actual text on the page, whether that is on a web page or in a document.

This does not mean you can't use a screenshot that has text in it. For example, if you are making training materials and use screenshots to show where an item is in a process or application, that is perfectly fine. However, do not use a screenshot of text to replace text on the page. If the viewer is meant to read all of the text in the image, that is when it should instead be text on the page.

Complex images

Some images are too complex for alt text, like an organization chart, or a line graph. Those types of images have different considerations, and may require a long description, or be accompanied by a table of data. Find out more about these types of images in our Data Visualization Accessibility guide.

Infographics are another type of complex image. It is not possible to add enough alt text to make an infographic clear to users of assistive technology. Typically to make an infographic accessible, you have a few options:

  1. If building your infographic in a tool like InDesign or Canva, export your infographic as a PDF and remediate it for proper tag structure in Adobe Acrobat.
  2. If building your infographic in a tool like Adobe Illustrator, and it is a flattened graphic where text cannot be selected, you will need to add a long description of your infographic. Include in the alt text of the graphic something like "Infographic describing process X. Long description follows." Then place a full text description of the infographic on the web page or following page of the PDF.

Adding alt text

Techniques for adding alt text will vary depending on whether you are making a Microsoft Office Document, editing a PDF in Acrobat, adding an image to a Content Management System (CMS), Learning Management System (LMS), or building a custom web page with HTML.

Video: Adding alt text

Alt text on different platforms

Microsoft Office documents or Outlook email

Right click context menu open on an image in Microsoft Word, with View Alt Text highlighted.
In Word, PowerPoint or Excel, if you do not add text to an image, the app will automatically generate example alt text. Because this is not always accurate, be sure to add your own alt text, or mark it as decorative.
  1. Right click an image in your document
  2. Select View Alt Text...
  3. In the Alt Text Panel, type in a description
  4. If the image is decorative, select the Mark as decorative (not available in Outlook)

Learn more about accessible Word documents

PDFs with Adobe Acrobat Pro

The alt text panel in adobe acrobat pro.
If you need to make changes to an existing PDF, you can do so in Adobe Acrobat Pro.  Navigate to Tools > Accessibility
  1. Choose Set Alternate Text
  2. Acrobat will detect all figures in your document and display any alt text that exists
  3. Enter the alt text for each image as it is highlighted

Or...

  1. Navigate to Tools > Accessibility
  2. Open the Reading Order tool
  3. Select the figure on the page
  4. Right-click and choose Edit Alternate Text
  5. Enter the alt text for the image in the box that appears

Learn more about making PDFs accessible with Acrobat

Content Management Systems (CMS) and Learning Management Systems (LMS)

When you upload an image to a CMS or LMS, you will typically be prompted with a box for alt text. The process will vary slightly based on the system you are using. Be sure to add alt text to this box. If you don't one of two things may happen depending on the configuration of your system: It may be marked as decorative and skipped completely, or it may leave the alt text blank which announces the filename of the image, which is not a helpful description.

HTML code

Within an <img> tag, you can use the alt attribute.
Code - Alt text description
<img src="/image.jpg" alt="One to two sentence description for the image." />

If the image is decorative, and you want to tell a screen reader to skip it completely, enter empty quotes, called a null, like the following:

Code - Alt text null
<img src="/image.jpg" alt="" />

Continue learning

Use of color Document and page structure Text and content