Important: This website does not attempt to establish a standard for how assistive technologies must behave. Read the FAQ for more information. Additionally, this is a work in progress. Please submit feedback or suggestions.

maxlength attribute (html)

Screen Reader support level: partial (2/11)

On this page

About this feature

The min and max attributes indicate the allowed range of values for the element.

Age of results

Results across all tests for this feature range from 6 months ago to 4 years ago. Detailed dates and version information can be found in associated tests.

Failing and partial results are between 6 months ago and 4 years ago.

Expectations

What are expectations?

Screen Reader support by expectation

ExpectationJAWSNarratorNVDAOrcaTalkBackVoiceOver (iOS)VoiceOver (macOS)
ChromeEdgeFirefoxEdgeChromeEdgeFirefoxFirefoxChromeSafariSafari
MUST convey when the maximum length is reachednonenonenonenonenonenonenonenonesupportednonesupported
MAY convey the maximum length when navigating to an inputnonenonenonenonenonenonenonenonenonenonenone

Expectation: convey when the maximum length is reached

Rationale:

The attribute prevents characters beyond the maximum length from being entered. The user needs to know when the maximum length has been reached, so that they do not think that they are entering data when they are in fact not.

Strength of this expectation for different types of assistive technologies:

  • Screen Readers: MUST
  • Voice Control: NA

Examples:

  • screen readers might announce an earcon when the user tries to enter data beyond the maximum length.
  • screen readers might imply that the maximum length has been reached by not announcing anything when a user tries to enter data (usually the keypress is echoed)
Screen Reader support for 'MUST convey when the maximum length is reached'
TestJAWSNarratorNVDAOrcaTalkBackVoiceOver (iOS)VoiceOver (macOS)
ChromeEdgeFirefoxEdgeChromeEdgeFirefoxFirefoxChromeSafariSafari
HTML maxlength attribute test applied to: input[type="text"] elementnonenonenonenonenonenonenonenonesupportednonesupported

Expectation: convey the maximum length when navigating to an input

Rationale:

The user may wish to know the maximum length when navigating to an input, and before they enter any data.

Strength of this expectation for different types of assistive technologies:

  • Screen Readers: MAY
  • Voice Control: NA

Examples:

  • screen readers might announce the maximum length when navigating to an input.
Screen Reader support for 'MAY convey the maximum length when navigating to an input'
TestJAWSNarratorNVDAOrcaTalkBackVoiceOver (iOS)VoiceOver (macOS)
ChromeEdgeFirefoxEdgeChromeEdgeFirefoxFirefoxChromeSafariSafari
HTML maxlength attribute test applied to: input[type="text"] elementnonenonenonenonenonenonenonenonenonenonenone