HTTP 401 vs 403

401 Unauthorized means the request has no valid authentication credentials at all; 403 Forbidden means the server knows who you are and is refusing anyway because you lack permission.

Updated: 2026-08-11

401: prove who you are

401 signals that authentication is required and either missing or invalid — the client should supply, or re-supply, credentials.

A compliant 401 response includes a WWW-Authenticate header describing how to authenticate; without it, clients have no standard way to know what's expected.

403: you are known, but not allowed

403 signals that the server understood the request and identified the caller, but refuses to authorize it regardless of the credentials supplied.

Re-authenticating does not change a 403 outcome — the fix is a permission or role change, not a new token.

A quick decision rule

No credentials, or credentials that fail to authenticate at all (expired token, bad password): 401.

Credentials are valid, but the authenticated identity isn't allowed to perform this action or see this resource: 403.

Engineering Notes

i
Some APIs deliberately return 404 instead of 403 to avoid confirming a resource exists to an unauthorized caller — that's a valid alternative when resource existence itself is sensitive, but it's a distinct design choice from the 401/403 split.

Related Concepts

HTTP

Related Tools

Related Reference