DevKits
500

Internal Server Error

5xx Server Error

Last updated:

A generic error message given when an unexpected condition was encountered on the server.

Description

The catch-all for 'something broke and we don't have a more specific code'. In practice, most unhandled exceptions in web frameworks bubble up as 500s.

When to use

Return 500 for unexpected exceptions. For expected failure modes, prefer more specific 5xx codes.

Common pitfalls

Do not leak stack traces in the response body — that's an information disclosure vulnerability.

Also searched as

Developers commonly search for 500 using phrases like 500 internal server error · 500 error · http 500 · 500 internal server error meaning · internal server error · 500 status code. All refer to the same HTTP 500 Internal Server Error response.

Specification

RFC 9110 §15.6.1

Examples

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

{"error":"Internal Server Error"}
Node.js (Express)
res.status(500).json({ error: "Internal Server Error" });
Go (net/http)
w.WriteHeader(http.StatusInternalServerError)
Python (Flask)
return jsonify({"error": "Internal Server Error"}), 500

Debug 500 with these tools

Related status codes

All 5xx codes