HTTPREF
← Back to status codes

HTTP Status Code

500 Internal Server Error

Server Error

The server encountered an unexpected error and could not complete the request.

HTTP status code reference, response example, common causes, fixes, and related status codes.

What does HTTP 500 Internal Server Error mean?

HTTP 500 Internal Server Error is a status code sent by a server to indicate the result of an HTTP request.

Status codes help browsers, APIs, apps, and backend systems understand whether a request succeeded, failed, was redirected, or needs additional action.

In practice, HTTP 500 Internal Server Error usually appears when a server responds under specific request, validation, permission, or infrastructure conditions.

Response example

HTTP/1.1 500 Internal Server Error

HTTP example

HTTP/1.1 500 Internal Server Error

Common causes

  • Unhandled exception
  • Application crash
  • Unexpected backend failure

How to fix it

  • Check server logs
  • Inspect recent deployments
  • Handle uncaught errors properly

Common mistakes

  • Assuming the status code alone explains the full backend issue
  • Ignoring related response headers that add important context
  • Treating temporary errors as permanent failures
  • Retrying too aggressively without checking the cause
  • Debugging the frontend only when the problem is server-side

How browsers and APIs use it

Browsers, APIs, and backend services use HTTP status codes to understand the outcome of a request. Depending on the status code, an application may render content, retry a request, redirect the user, show an error, or trigger a different flow in the client or server.

Developer note

HTTP 500 is a generic server-side failure. If you see it in development, the real cause is usually in logs, stack traces, or server monitoring.

Client-side example

if (response.status >= 500) {
  console.log("Server error, try again later");
}

Related status codes