Error Message Design
Error messages are where interfaces either help or blame. A good error says what went wrong, why, and exactly how to fix it, right where the problem is.
By Mohamed Farhan · Updated Oct 19, 2026
Enter an email like name@company.com
Inside the example
The live example above is plain HTML with Tailwind utility classes, so you can paste it into any Tailwind project. It uses type sizes text-sm (14px) and spacing mt-1.5 (6px), px-3 (12px), py-2 (8px), gap-1.5 (6px), constrained by max-w-sm. Everything sits on a 4px grid, which keeps rhythm consistent when you adapt it.
Colors use Tailwind's neutral stone scale so the pattern stays brand-agnostic. Swap stone-900 for your primary color on the main action, keep body text dark and check contrast after any change.
Anatomy
- 1.Placement
- Next to the field or area with the problem.
- 2.Indicator
- Color plus an icon or text, never color alone.
- 3.Message
- What happened and how to fix it.
- 4.Summary
- For long forms, a list of errors at the top.
Common variations
- Inline field errors, next to the input with the problem.
- Error summary, a list at the top of long forms after submit.
- Banner errors, for problems that affect the whole page, like a failed save.
- Full-page errors, such as 404 or 500 pages.
States to design
- Before interaction: no errors shown.
- After leaving a field: inline validation appears if needed.
- After submit: summary at the top and inline errors on each field.
- Resolved: error disappears as soon as the input is valid.
A walkthrough
A new user fills in a signup form and types 'maya@studio' as her email. When she moves to the next field, a message appears right under the email: 'Enter an email like name@company.com', with an icon and a red border on the field. Her text stays in place, so she only needs to add '.co'.
She submits the form and the password does not meet the rules. A summary at the top lists the problem and links to the field, and focus moves to that summary so screen reader users hear it immediately. She fixes the password, the error disappears as soon as it is valid, and the form submits. When the server is briefly unavailable, a banner says the account could not be created yet and offers to try again, without clearing what she typed.
How different products use it
Signup and login forms need clear errors for passwords, emails and existing accounts, without revealing security-sensitive details.
Checkout and payment flows must explain card declines and address problems precisely, because each error risks a lost sale.
Data-heavy tools show validation errors in tables and bulk imports, often summarizing errors per row.
Visual design guidelines
Inline errors usually sit directly below the field in a red that passes contrast against the background (such as a deep red rather than a bright one), at 13 to 14px, with an icon. The field border changes to the error color and becomes slightly thicker. Error summaries at the top of forms use a tinted background, a heading and a list of links to each field.
Best practices
Do
- Explain how to fix the problem, not just that it exists.
- Validate when users leave a field, not on every keystroke.
- Keep the user's input; never clear a field because it was wrong.
- Use human language and avoid error codes in the main text.
Don't
- Do not blame users ('You entered an invalid...').
- Do not show errors before users have had a chance to type.
- Do not use toasts for form validation errors.
On mobile
On mobile, errors can be hidden by the keyboard. Scroll the first error into view, keep messages short, and avoid placing error text where it will be covered by the keyboard or sticky buttons.
Common mistakes
- Blaming language such as 'You entered an invalid value'.
- Clearing the user's input after an error.
- Color-only errors with no icon or text.
- Generic messages like 'Something went wrong' with no next step.
Edge cases to plan for
- Multiple errors on one field should show the most important one first.
- Server-side errors that apply to the whole form need a banner, not inline messages.
- Errors in collapsed sections must expand the section so users can see them.
- Autofilled fields may trigger validation unexpectedly; validate gently.
Accessibility checklist
- Link errors to fields with aria-describedby and set aria-invalid.
- Move focus to the error summary on submit.
- Use role="alert" for errors that appear after submitting.
Implementation notes
Set aria-invalid="true" on invalid fields and connect messages with aria-describedby. On submit, show an error summary with links to each field and move focus to it. Use role="alert" for errors that appear without user focus moving.
In your design system
In a design system, errors appear in several components: field error text, an error summary, a page-level alert and full-page error templates. Define a single error color that passes contrast, a shared icon, and copy guidelines, and build the field components so they handle aria-invalid and aria-describedby automatically.
How to measure whether it works
Track which fields cause the most errors and how often users fail to submit. Frequent errors on the same field often mean the label, format or validation rules need to change.
Pre-launch checklist
Microcopy you can use
A step-by-step design process
- List every validation rule and possible server error.
- Write a message for each that explains how to fix it.
- Decide timing: on blur, on submit or as the user types.
- Design inline, summary and banner errors.
- Connect errors to fields for assistive technology.
- Test with real users to find confusing rules.
Usability test tasks
Before shipping, run a short usability test with five or so people from your audience. Give them tasks rather than instructions and watch where they hesitate:
- Submit the form with a missing field and fix it.
- Find all errors on a long form.
- Recover from a failed payment.
- Fix an error using a screen reader.
Key terms
- Inline validation: Checking a field and showing errors next to it.
- Error summary: A list of all errors at the top of a form.
- aria-invalid: Marks a field as having an error.
- aria-describedby: Connects an error message to its field.
Writing the copy
Good error messages follow a simple formula: what happened, why if helpful, and how to fix it. 'Enter a date in the future' is better than 'Invalid date'. Avoid blaming the user, technical jargon and humor in errors that cost users time or money.
Prompts to generate variations
If you use an AI UI generator such as Inspo AI, these prompts are a good starting point for exploring variations of this pattern:
- Design form error states for a signup form with inline errors, an error summary and a server error banner.
- Create checkout error messages for declined cards and invalid addresses.
- Design a bulk import error view that groups errors by row.
Related patterns
Errors are closely related to forgot password flows, toast notifications and form design best practices.
Generate this pattern for your product
Inspo AI designs the full pattern with every state, grounded in how real products solve it, and exports React + Tailwind.
Sources and further reading
- WAI-ARIA Authoring Practices Guide · Accessible keyboard and screen reader patterns for UI components.
- WCAG 2.1: Non-text Contrast · Contrast requirements for buttons, borders and icons.
- WCAG 2.1: Use of Color · Why color should never be the only way information is shown.
- Nielsen Norman Group articles · Usability research on interface patterns.
More UI patterns
Questions people ask
What makes a good error message?
It says what went wrong in plain language, explains how to fix it and appears right next to the problem.
Should error messages be red?
Red is the convention, but always pair it with an icon or text so color-blind users can see the error too.
When should form validation run?
Usually when a user leaves a field (on blur) and again on submit. Validating every keystroke can feel like nagging.
Should I validate as the user types?
Usually not for most fields. Validate when users leave a field and on submit; real-time checks are helpful for things like password strength.
What should a server error message say?
That the action failed, that it was not the user's fault, and what to do next, such as retrying or contacting support.

↘ Building Inspo AI | AI-Powered Design Research & Builder Platform | Design Engineer.