HTTP Status Codes / 5xx HTTP Status Codes / HTTP 500

500 Internal Server Error

This is an educational reference page about HTTP 500 Internal Server Error. The page itself is served as 200 OK so it can be indexed as HTTP documentation.

The server encountered an unexpected condition that prevented it from fulfilling the request.

Specification

Registered in the IANA HTTP Status Code Registry as Internal Server Error. Defined in RFC 9110, Section 15.6.1.

What it means

HTTP 500 Internal Server Error means the server hit an unexpected condition and could not complete the request. It is the catch-all server error: frameworks return it when application code throws an exception that nothing handles.

When to use it

Common causes

How to fix it

Examples

Unhandled error with a request ID

GET /api/invoices/2026-0193 HTTP/1.1
Host: api.example.com

HTTP/1.1 500 Internal Server Error
Content-Type: application/problem+json

{
  "type": "https://api.example.com/problems/internal-error",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "Something went wrong on our side.",
  "requestId": "req_8f2c1a"
}

Common mistakes

Developer notes

Clients can retry GET and other idempotent requests after a 500 with backoff. RFC 9110 says clients SHOULD NOT automatically retry non-idempotent requests unless they know the request is safe to repeat. An idempotency key is one way for an API to make a POST safe to repeat.

Questions

What does HTTP 500 Internal Server Error mean?

HTTP 500 means the server hit an unexpected condition and could not fulfill the request.

Is a 500 error my fault or the server's?

A 500 is a server-side failure. The request may have triggered it, but the server should have returned a 4xx if the request was invalid.

Should I retry after a 500?

Retry idempotent requests such as GET with backoff. Do not blindly retry POST unless the API supports idempotency keys.

See also

Header and content rules

RFC 9110 adds no header or content rule specific to 500. The 5xx class rules also apply. See 500 in the response obligations table.

Related comparisons

Related API error guide

Use RFC 9457 Problem Details to add a standard application/problem+json body without changing the meaning of HTTP 500.

5xx server error – the server failed to fulfill an apparently valid request


HTTP status code lookup
REST API status code chooser
cURL command generator
By Ping Now, a website/API/service uptime monitor
Data from Wikipedia