Skip to main content Skip to list of patterns
Service phase: Beta

This is a new service – give us your feedback to help improve it.

Patterns

Error pages

Provide users with clear and helpful error pages when something goes wrong.

Contents

Provide the user with information about the error:

Error type
A very short description of the error in present tense such as "Page not found"
Error details (optional)
More details about why the error may have occurred
Suggested next steps
Some possible next steps that the user can take

Also include the response code from the service to allow the user to pass on helpful information to the supporting team.

Open this example in new tab

Test all links and buttons to make sure they work. Remember to do the hard work to make it simple.

The page should have:

Contact information should either be:

Have clear and concise content and do not use:

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Page not found</h1>
<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p>If the web address is correct or you selected a link or button, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to let us help.</p>

Use a page not found error if someone is trying to view a page that does not exist. This happens if someone:

The server should return a 404 response code.

Follow the advice on Page not found pages on the GOV.UK Design System.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Restricted</h1>
<p>You are not permitted to view this content.</p>
<p>If you typed the web address, check it is correct.</p>
<p>If you pasted the web address, check you copied the entire address.</p>
<p>If you believe you should be able to view this content, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to request access.</p>

Use a restricted access error if someone is trying to view a page or resource that they shouldn’t be allowed to. This can happen if:

The server should return a 401, 403 or 407 response code.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">The page you requested cannot be served</h1>
<p>You have requested a page that cannot be served. This could be because the web address you entered or the data you posted was incorrect.</p>

Use a unknown request error if someone is requesting something that doesn't make sense.

For example, the user could manually change a URL from having ?year=2001 at the end to ?year=abc. In this instance, we don't know how to respond to the request because we expect a year to be a number.

If the user uses a URL that is valid but just doesn't have any results (for example ?year=1234567890), use a page not found instead.

A user could also try and visit a URL that was meant to receive form data (using GET rather than a POST). In this instance, the server should respond with an unknown request error.

The server should return a 400, 405 or 406 response code.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">There is a problem with the service</h1>
<p>Try again in a few minutes.</p>
<p>If the web address is correct or you selected a link or button, <a href="https://www.nationalarchives.gov.uk/contact-us/">contact us</a> to let us help.</p>

Use a service issue error if someone is trying to view a page that the service is currently unable to render. This can happen if:

The server should also return a response code in the 5xx range.

Follow the advice on Service unavailable pages on the GOV.UK Design System.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Sorry, the service is unavailable</h1>
<p>Try again in a few minutes.</p>

Tell the user a service is unavailable on purpose (for example during maintenance). These are also known as shutter pages.

The server should return a 503 response code.

Follow the advice on Service unavailable pages on the GOV.UK Design System.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Too many requests</h1>
<p>You have requested too many resources in a set timeframe.</p>
<p>Try again in a few minutes.</p>

Use a rate limited error if someone makes too many requests to a service.

This error will mainly be aimed at bots and tools that are used to scrape content from the site, often sending enough requests to slow down parts of our system.

Don’t give details on how many requests in a given timeframe will trigger the error or how long until they are able to make more requests.

The server should return a 429 response code.

Open this example in new tab

HTML

<h1 class="tna-heading-xl">Page no longer exists</h1>
<p>A version of the old page can still be viewed in the <a href="https://www.nationalarchives.gov.uk/webarchive/">UK Government Web Archive</a>.</p>
<p>The archive shows the page as it appeared on <strong><time datetime="2026-02-03">3 February 2026</time></strong> (6 months ago).</p>
<div class="tna-button-group">
  <a href="#" class="tna-button">
    View archived page
  </a>
</div>

If the page has been archived, inform the user where the page has moved to and if possible, when the page was last captured.

For pages archived in the UK Government Web Archive, you can check for the information using the CDXJ API. See CDXJ API documentation for more details.

As an example, the API can provide a list of the captures for this design system.

The server should return a 410 response code.

This is a suggested list of error pages for each server response code.

A complete list of responses that are available for error pages can be found on MDN: HTTP response status codes. Use your own judgement when writing error pages for other response codes.

Something not right?

We are working to improve this service and appreciate your input.