Skip to content

Main content

Alternative Text Decorativeflag Tool

Resolve the alt attribute for an explicitly decorative image to the empty string; meaningful-image text remains caller-supplied and is not judged.

Loading tool…

Description

Return an empty recommendedAltAttribute when decorative is true, otherwise suppliedAlt.

Accessibility decisions depend on the person, context, content, and relevant design requirements. A supplied measurement or formatting check addresses one condition and cannot establish that an entire interface, sign, or space is accessible.

Return an empty recommendedAltAttribute when decorative is true, otherwise suppliedAlt.

When to use this tool

Use Alternative Text Decorativeflag when you need one documented accessibility component under a supplied criterion.

How to use the tool and how it works

  1. Enter decorative, suppliedAlt. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read recommendedAltAttribute, nonemptyAltOnDecorative. Inspect nonemptyAltOnDecorative before interpreting the associated values.

Return an empty recommendedAltAttribute when decorative is true, otherwise suppliedAlt. Independently flag a nonempty supplied alternative on a decorative item.1

WAI guidance uses an empty alt value for an image that is decorative in its context. Deciding that role requires judgment about the actual page; the supplied flag cannot make that assessment.2

Input fieldMeaning and unitsAccepted input
decorativeCaller-supplied judgment that the image is decorative in its actual context.Required. Boolean.
suppliedAltExisting alternative text to inspect; the tool does not interpret the image.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
recommendedAltAttributeEmpty for a supplied decorative flag; otherwise the supplied text.Required. Text; maximum UTF-16 length 8192.
nonemptyAltOnDecorativeWhether the caller marked the image decorative while supplying nonempty alt text.Required. Boolean.
json
{
  "input": {
    "decorative": true,
    "suppliedAlt": "flourish"
  },
  "output": {
    "recommendedAltAttribute": "",
    "nonemptyAltOnDecorative": true
  }
}

Limitations and assumptions

  • The decorative decision is supplied; no image, context, text quality, accessible name, or full accessibility compliance is evaluated.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Evaluate the complete experience with relevant guidance, appropriate expertise, and people who use the access features.

References

  1. Calculation and input contract: disability-studies/alternative-text-decorativeflag — tool.io

  2. Images Tutorial: Decorative Images — W3C Web Accessibility Initiative

Similar or alternative tools