HTML Error Codes

HTML provides a number of error code responses, each relates to a request made on a server and the status of either the server or the website content.

They should really be thought referred to as status codes.

Often referred to as error codes the messages can be both error related or informative, for example the well known 404 error, detailing that the file requested cannot be found. Or conversely the 200 code, which confirms that the action completed successfully.

Some errors will give information about the server status. An example of this is the 503 error code which details that the server is out of resources.

Each request made to the server will give an error code. Web pages are commonly composed of multiple components: images, script and CSS resource files. Each one of these is treated separately regards the return of an error code.

The codes are grouped together in series:

  • 1xx – Information
  • 2xx – Successful
  • 3xx – Redirection
  • 4xx – Client error
  • 5xx – Server error

The table below gives a summary of the main codes.

CodeDescriptionComments
100ContinueThe request headers have been received. The client can continue with the remainder of the request.
101Switching ProtocolsThe requester has asked the server to switch protocols
200OKAction completed successfully. In general this is the response received for web page content.
201CreatedSuccess following a POST command
202AcceptedThe request has been accepted for processing. Processing not completed.
203Partial InformationResponse to a GET command, indicating that the returned meta information is from another resource/website.
204No ContentThe server has received the request. No information is available to send back.
205Reset ContentThe server completed processing the request. But is not returning any content.
206Partial ContentThe requested file was partially sent. This is usually caused by stopping or refreshing a web page.
300Multiple Choices
301Moved PermanentlyThe requested directory, or file, has been moved permanently to another location. The browser is expected to retry the new location.
302Moved TemporarilyThe requested directory, or file, has been moved temporarily to another location. The browser is expected to retry the new location.
303See Other The response to the request is to be found under another URL. Details are in the response.
304Not ModifiedThe cached version of the requested file is the same as the file to be sent.
305Use ProxyThe requested response is available through a proxy. This should be used to access the content, details are available in the response.
307Temporary RedirectThe request should be repeated using the supplied URL. Future requests to revert to the original URL. Same request method, eg POST, to be used in revised URL.
308Permanent RedirectThe request should be repeated using the supplied URL. The change is permanent and should be followed for future requests. Same request method, eg POST, to be used in revised URL.
400Bad RequestThe request had bad syntax or was impossible to be satisfied.
401UnauthorizedA valid user name and password were not supplied to access the file/directory.
402Payment RequiredLittle used, original purpose not taken up.
403ForbiddenNo file name given in the request. Or the specified directory does not have the necessary permission to allow it to be viewed from the web.
404Not FoundThe requested file was not found.
405Method Not AllowedA method was used to access a resource which is incompatible with that resource. Typical example is the wrong type of form request, GET on a form expecting POST and vice versa.
406Not AcceptableThe acceptable content, as detailed in the request, cannot be full filled, The content provided by the server does not match the accepted content.
407Proxy Authentication Required Authentication is required with a proxy before the request can be processed.
408Request Time-Out The server timed out waiting for the clients subsequent response.
409ConflictThere was a conflict whilst accessing the resource. an example is an edit being made on a file.
410Gone Indicates that the requested resource has been removed and is no longer available.
411Length Required The request did not include the length of its content.
412Precondition Failed The requester included a condition which the server does not meet.
413Request Entity Too Large The request provided is too large for the server to handle.
414Request-URL Too LargeThe length of the URL sent to the server is too long. Most times this is too much info in the querystring.
415Unsupported Media Type The requested media type is not supported/configured by the server.
500Server ErrorA general error message. This is given when a more specific message is suitable.
501Not ImplementedThe server does not support the request method.
502Bad GatewayEither an intermediate server has a communication issue or the servers completing the request are not working correctly together.
503Out of ResourcesThe server cannot process the request due to a system overload.  This should be a temporary condition.
504Gateway Time-OutThe service did not respond within the time frame that the gateway was willing to wait.
505HTTP Version not supportedThe server doesn’t support the protocol standard used in the request.

Not all errors are reported within the browser.

To view the full messages fed back when viewing a web page tools such as Fiddler and Wireshark can be used.