Skip to content
Ben Serkan Zararsız

Write errors people can fix

“Invalid input” tells people they failed. A good error message tells them how to succeed.

On this page
  1. Intro
  2. Say what happened and what to do
  3. Put it where the problem is
  4. And at the right time
  5. Mark what is optional

An error message is the moment your product talks to someone who is already a little frustrated. Most products choose that moment to be vague, technical or slightly accusing.

Say what happened and what to do

Every error needs two things: what went wrong, in plain words, and how to fix it. “Invalid date” is half a message. “Please enter the date as DD.MM.YYYY” is a whole one. If the system knows the answer, it should not make people guess.

Put it where the problem is

An error belongs next to the field it is about, and it stays until the problem is solved. A red list at the top of the page sends people searching. Do not rely on red alone either: add an icon and text, so everyone can see it.

Book a tableBooked ✓
Please enter the date as DD.MM.YYYY, like 24.08.2021.

At the field, with the fix, input kept

Book a tableBooked ✓

A banner on top, and everything cleared

Fix the date on the left: the message goes as soon as it is right.

And at the right time

Do not shout while people are still typing. Check a field when they leave it, and confirm when it is right. And never clear what they already entered because one field was wrong.

Mark what is optional

Some errors can be prevented before anyone types. Most forms put a red star on every required field. The form starts to look like a list of warnings, and the star only works for people who find its legend. Usually almost every field is required anyway, so mark the exception: add “(optional)” to the few fields people can skip. A word needs no legend.

Book a table

Only the exception is marked, in words

Book a table

* Required field

A star on every field, explained in a legend

Same form, same rules. Which field can you skip?

In the code, required fields keep their required attribute, so screen readers still announce them. And before you add an optional field, ask if you need it at all.

Read your error messages out loud. If one would sound rude said across a desk, rewrite it.

Sources

  1. Nielsen Norman Group: Error-Message Guidelines
  2. Baymard Institute: Usability Testing of Inline Form Validation
  3. W3C: Understanding WCAG 2.1: Error Suggestion
  4. GOV.UK Design System: Question pages