How do I write accessible form error messages?

Published 7 November 2026 · Last updated · General information, not legal advice

An accessible error message says, in text, which field has the problem and how to fix it, and it is connected to that field so screen readers announce it. "Enter your postcode, for example SW1A 1AA" next to the postcode field passes; a red border alone does not. WCAG 3.3.1 Error Identification (level A) asks that when an input error is detected automatically, the item in error is identified and the error is described to the user in text.1 WCAG 3.3.3 Error Suggestion (level AA) goes a step further: if you know how the visitor could correct it, tell them, unless that would put security at risk.2

Why error messages matter so much

Errors happen at the worst moments: at checkout, at sign-up, on the contact form. W3C points out that people may abandon a form after a failed submission because they cannot tell how to fix the error.2 For a store, that is a lost order. The people most affected include screen reader users who never hear that something went wrong, people with low vision who cannot see a red outline far down the page, and people with cognitive disabilities who are told there is an error but not what to do about it.2

What the two criteria ask

CriterionLevelRequiresExample
3.3.1 Error IdentificationAIdentify the field in error and describe the error in text"Email address: this field is required"
3.3.3 Error SuggestionAASuggest a correction when one is known, unless it would compromise security or purpose"Enter an email address in the format name@example.com"
3.3.2 Labels or InstructionsALabels or instructions where input is needed, including data formats"Date of birth (DD/MM/YYYY)"

W3C defines an input error as information the visitor gave that is not accepted: required information left out, or information outside the required format or allowed values.1 3.3.1 does not prescribe how errors are displayed, but it is clear that colour or highlighting can only be added alongside a text description, and that re-showing the form without any hint that it failed is not enough.1

The exception in 3.3.3 covers suggestions that would jeopardise the security or purpose of the content.2 A login form is the obvious case: it should say the details were not recognised, not hint at the right password.

Writing messages people can act on

  • Name the field. "Postcode is required", not "This field is required" in a list at the top.
  • Say what is wrong and what to do. "Card expiry date must be in the future" is better than "Invalid date".
  • Give an example of the right format where formats matter, such as phone numbers and dates. W3C's own 3.3.3 example offers the list of valid months, or asks "Do you mean 'December'?".2
  • Avoid blame and jargon. "Error 422" or "Invalid input" helps no one.
  • Prevent errors where you can. Tell people formats and requirements before they type, as 3.3.2 asks, and accept common variations, such as spaces in a card number.4
  • Keep what they typed. Do not clear the form after an error.

Making screen readers announce errors

Errors shown after submitting

W3C's forms tutorial recommends a pattern that works well for checkout and long forms:3

  1. List the errors at the top of the form, under a distinctive heading such as "There are 2 problems with your details".
  2. Make each item a link that takes the visitor to the field.
  3. Move focus to the error list, or to the first field with an error.
  4. Put the error count in the page title too, such as "2 errors: Delivery address", because screen reader users hear the title as soon as the page loads.

In multi-step checkouts, W3C's multi-page forms tutorial suggests putting progress at the start of the title, such as "Step 2 of 4: Shipping Address", and notes the title can carry an error notice as well.7

Errors next to each field

Show the message beside the field and connect it in the code. The tutorial says fields can be associated with their error messages using aria-describedby, so a screen reader reads the message when the field gets focus.3 W3C also lists aria-invalid on the field in error as a technique for 3.3.1 (ARIA21).1 Mark required fields in the label, in text or with an asterisk explained at the top of the form; W3C's examples for 1.3.1 show required-field indicators that are programmatically associated with the field.5

Errors that appear as people type

If a message appears without a page load and without moving focus, it is a status message under WCAG 4.1.3 and needs to be announced.6 W3C's technique for errors is ARIA19: using role="alert" or a live region.6 Use it sparingly. The tutorial explains that an assertive live region interrupts whatever the screen reader is saying, while a polite one waits for a pause.3 Announcing "invalid email" after the first letter is typed is noise; checking when the visitor leaves the field is usually better for formats like dates.3

Browser validation

Adding required or type="email" to a field lets the browser show its own messages. W3C says this can meet 3.3.1, but warns that these messages may disappear, may not scroll with the page or enlarge with zoom, are often generic, and show only one error at a time.1 Test them on your site before relying on them.

Shopify and WordPress

On Shopify, test checkout and also the forms your theme and apps add: contact, newsletter, account sign-up, product options such as engraving text, and any custom forms from apps. On WordPress and WooCommerce, error messages come from WooCommerce, your theme and form plugins. In both, submit each form empty, then with deliberately wrong values, and check what you see and what a screen reader says.

How to test your error messages

  1. Submit each form with everything empty. Is every problem described in text, next to the right field?
  2. Enter wrong formats: a short phone number, a past expiry date, an email without "@". Do the messages tell you how to fix it?
  3. Repeat with a screen reader. After submitting, do you hear that there are errors? When you move to a field, do you hear its message?
  4. Zoom to 200%. Are the messages still visible and next to their fields?
  5. Run an automated check for missing labels and broken references. Jralo's free check tests your homepage and up to five linked pages against WCAG 2.2 A and AA, and helps you understand which countries' accessibility laws may be relevant, with a link to a guide for each (general information, not legal advice).

Automated tools find many problems, not all, and error handling is mostly invisible to them: a tool loads the page but rarely submits your forms with bad data. The manual steps above are where error messages get tested. For the keyboard and screen reader basics, see how to check your website in 15 minutes.

What else do people ask?

Is a red outline on the field enough?

No. W3C's guidance for 3.3.1 says the error must be indicated in text. Colour, icons and highlighting can be added, but only alongside a text description. Re-showing the form with no hint that submission failed is not enough either.

Should I validate as people type?

It depends on the field. W3C's forms tutorial says instant feedback can be very helpful but does not suit every situation. For formats like dates, checking when the visitor leaves the field avoids showing errors before they have finished typing. Always check again on submit.

Can I rely on the browser's built-in validation messages?

With care. W3C notes that native validation can meet 3.3.1, but its messages may disappear, may not enlarge with zoom, are often generic and show one error at a time. Many sites switch it off and show their own messages next to each field.

Check your site now

Jralo's free check tests your homepage and up to five pages for accessibility (WCAG 2.2 A and AA) and website QA problems, and tells you which countries' accessibility laws are likely relevant to you. No sign-up.

Run the free check

Where do these facts come from?

Every number and legal statement in this post links to one of these sources, read on 13 October 2026.

  1. W3C WAI: Understanding Success Criterion 3.3.1 Error Identification
  2. W3C WAI: Understanding Success Criterion 3.3.3 Error Suggestion
  3. W3C WAI: Forms tutorial, User Notifications
  4. W3C WAI: Understanding Success Criterion 3.3.2 Labels or Instructions
  5. W3C WAI: Understanding Success Criterion 1.3.1 Info and Relationships
  6. W3C WAI: Understanding Success Criterion 4.1.3 Status Messages
  7. W3C WAI: Forms tutorial, Multi-page Forms

More questions

What should you read next?