GDS Error Pages: How They Should Look and Work
In this article
GDS error pages and messages follow the GOV.UK design system: a red error summary box at the top of the page, a clear message above each field that failed, and links that jump straight to the problem. Most "GDS error page" problems come from missing one of those three parts.
Time 20 min · Steps 7 · Level Medium
The seven parts of a GOV.UK error page
- Add an error summary box. A red-bordered box appears at the top of the page, under the header and any back link, with the heading "There is a problem".
- List each error as a link. Each link in the summary points to the field or question it describes, so selecting it moves focus to that field.
- Mark the page title. The page title starts with "Error:" so screen reader users hear it first when the page reloads.
- Put a red message above the failing field. The message sits between the label (or legend) and the input, prefixed with "Error:" for screen readers.
- Describe what went wrong, not what to do. "Enter your full name" beats "Invalid input"; the field itself already tells users where to type.
- Keep the user's input. Never clear a correctly filled field because another field failed validation.
- Move focus to the summary. When the page reloads after a failed submit, keyboard focus goes to the error summary box so users hear all the problems at once.
What a GDS error page normally looks like versus what is broken
It is normal for the error summary to appear only after the user tries to continue, and for inline messages to appear only on fields that actually failed. It is also normal for the URL to stay the same, since the page simply reloads with errors rather than sending the user somewhere new.
A real problem is anything that hides the error from part of your audience. If the summary is missing, keyboard and screen reader users can be dumped back at the top of a long form with no signal anything went wrong. If the page title is unchanged, a screen reader user hears the same title as before and may believe the submit worked. If error text is red alone with no prefix, colour-blind users lose the signal entirely.
| Symptom | Likely cause | Fix |
|---|---|---|
| Summary box missing | Component not rendered on validation failure | Render the error summary component whenever the form returns errors, and set focus to it |
| Links in summary do nothing | Link targets do not match field IDs | Point each link at the ID of the input, or of the first input in a group |
| Errors read out twice | Message duplicated in summary and visually hidden text | Use one visually hidden "Error:" prefix per message, not per element |
| Radio or checkbox errors unclear | Message placed outside the fieldset | Put the error message inside the fieldset, above the legend, linked to the fieldset |
| Page title unchanged | Title not set on error | Prefix the title with "Error:" when errors are present |
| File upload shows no error | Client-side validation skipped for file inputs | Validate on the server and return a standard error message for the upload component |
Fixing the most common cause: a summary that is not linked or focused
Most broken GDS error pages fail at the wiring between the summary and the fields. Fix it in this order:
- Open the page after a failed submit and confirm the red summary box with "There is a problem" is the first thing under the page header.
- Select one of the links in the box. The browser should jump to the matching field and focus it, not just scroll near it.
- If nothing happens, check that the link's target matches the input's ID exactly, including capitalisation.
- For a group of radios or checkboxes, target the first input in the group, not the fieldset wrapper.
- Press Tab from the top of the page. Focus should land on the summary box itself, which needs a tabindex attribute applied when errors render.
- Reload the page and confirm the browser title begins with "Error:".
- Test with a screen reader if you can; the summary heading should be announced when focus lands on the box.
Menu names and component options differ slightly between versions of the GOV.UK frontend packages, so check the component examples in the design system against the version you ship.
Quick checks before you call it done
- Page title starts with "Error:" when validation fails.
- Summary appears above the main heading, below the back link.
- Every summary link moves focus to a real field.
- Each failing field has a red message between the label and the input.
- Messages start with a capital and do not end with a full stop, matching GOV.UK content style.
- Valid answers the user already typed are still there after the reload.
- Focus lands on the summary, not the first field, after a failed submit.
Stopping GDS error pages from breaking later
Write the validation and the error text together, so a new rule always ships with its message. Keep messages short and specific: "Enter your National Insurance number" rather than "Invalid format". Give each field a stable ID at build time so summary links do not break when layouts change. Test the error state as part of your normal checks, not only the happy path, and include one keyboard-only pass and one screen reader pass on your longest form. If a question can fail in more than one way, write a separate message for each, because a single vague message forces the user to guess which rule they broke.
Questions that come up with GDS error pages
Should the error summary appear for a single error?
Yes. Even one failed field gets the summary box plus the inline message, so the pattern stays consistent and screen reader users get the same signal as everyone else.
Can client-side validation replace the error summary?
No. Server-side validation is the source of truth, because users can have JavaScript off or hit a state the browser checks missed. Client-side checks can improve feel, but the server must still render the full error pattern.
What about errors that are not about a specific field?
For a problem that belongs to the whole page, such as a service outage or a session that expired, use a standard error page with a clear heading, a plain explanation of what happened, and what the user can do next, rather than the form error summary.
How long should an error message be?
One short line naming the field and the problem. If you find yourself explaining validation rules in the message, move that explanation into the hint text above the field so it is there before the user fails, not after.
Official source: GOV.UK Design System (Government Digital Service)