← Back to Developer Tools
📡

HTTP 404 Not Found — Meaning, When to Use, and Examples

All 34 status codes · Search · Filter · Snippets · cURL Tester · Favorites

💡

HTTP 404 Not Found is returned when the server cannot find the requested resource. It is the most famous HTTP status code. This guide covers when to use 404 vs 410 Gone, the security pattern of returning 404 instead of 403, and code examples for Express.js, Flask, and nginx.

1xx4
2xx5
3xx5
4xx13
5xx7
🌐 Live Status Checker
CORS-safe — works for public APIs and your own endpoints
100
Continue
Server received request headers, client should proceed
Upload
101
Switching Protocols
Server is switching to the protocol specified in Upgrade header
WebSocket
102
Processing
Server has received and is processing the request (WebDAV)
REST
103
Early Hints
Server sends preliminary hints for browser to preload resources
Cache
200
OK
Request succeeded — standard success response
RESTSuccess📦 Cacheable
201
Created
Request succeeded and a new resource was created
RESTSuccess
202
Accepted
Request accepted but processing not yet complete
REST
204
No Content
Request succeeded but no response body
RESTSuccess
206
Partial Content
Server is delivering only part of the resource (range request)
UploadCache📦 Cacheable
301
Moved Permanently
Resource permanently moved to new URL — use Location header
RedirectCache📦 Cacheable
302
Found
Resource temporarily at different URL — method may change
Redirect
304
Not Modified
Resource not changed since last request — use cached version
Cache📦 Cacheable
307
Temporary Redirect
Temporary redirect — HTTP method preserved
Redirect
308
Permanent Redirect
Permanent redirect — HTTP method preserved
RedirectCache📦 Cacheable
400
Bad Request
Server cannot process request due to client error
RESTError
401
Unauthorized
Client must authenticate to get the requested response
AuthError↺ Retryable
403
Forbidden
Client is authenticated but not authorized for this resource
AuthError
404
Not Found
Server cannot find the requested resource
RESTError📦 Cacheable
405
Method Not Allowed
HTTP method not allowed for this resource
RESTError
408
Request Timeout
Server timed out waiting for the request
Error↺ Retryable
409
Conflict
Request conflicts with current state of the server
RESTError↺ Retryable
410
Gone
Resource permanently deleted — unlike 404, this is intentional
RESTErrorCache📦 Cacheable
411
Length Required
Server requires Content-Length header
UploadError
413
Content Too Large
Request body exceeds server size limit
UploadError
415
Unsupported Media Type
Server rejects request due to unsupported Content-Type
RESTError
422
Unprocessable Content
Request is well-formed but has semantic errors (validation failed)
RESTError
429
Too Many Requests
Client has sent too many requests (rate limited)
AuthErrorREST↺ Retryable
500
Internal Server Error
Server encountered unexpected error
Error↺ Retryable
501
Not Implemented
Server does not support the functionality required
Error📦 Cacheable
502
Bad Gateway
Upstream server returned invalid response
Error↺ Retryable
503
Service Unavailable
Server temporarily unavailable — overloaded or down for maintenance
Error↺ Retryable
504
Gateway Timeout
Upstream server did not respond in time
Error↺ Retryable
507
Insufficient Storage
Server unable to store the representation (WebDAV)
UploadError↺ Retryable
511
Network Authentication Required
Client needs to authenticate to gain network access (captive portal)
AuthError↺ Retryable
📡

Click any status code to see full details, code snippets, and usage guide

NavigateEsc CloseCtrl+F Search
Ctrl+F Focus search Navigate codesEsc Close detailCtrl+L Clear filters

Frequently Asked Questions

What does HTTP 404 Not Found mean?

404 Not Found means the server cannot find the requested resource — the URL does not map to any existing content. It may mean the page was deleted, the URL was mistyped, the resource never existed, or the server is deliberately hiding a resource that exists (security pattern). It does not necessarily mean the URL will never work — use 410 Gone for deliberately deleted content.

What is the difference between 404 and 410?

404 Not Found is ambiguous — the resource may or may not have existed. 410 Gone explicitly states the resource previously existed and was permanently removed. For search engine optimization, 410 is a stronger signal for crawlers to deindex the URL immediately, while 404 may take longer. Use 410 for deliberately deleted blog posts, products, or API endpoints.

Should I return 404 or 403 to protect private resources?

From a security perspective, returning 404 instead of 403 for private resources is a best practice. A 403 reveals the resource exists and the user lacks permission — an attacker gains information. A 404 reveals nothing about whether the resource exists. This is called "security by obscurity" and is recommended for user profiles, private files, and admin endpoints.

How do I return 404 in Express.js?

res.status(404).json({ error: "Not Found", message: "Resource not found" }). For a global 404 handler, add after all routes: app.use((req, res) => { res.status(404).json({ error: "Route not found" }); }). In async route handlers, use: if (!user) return res.status(404).json({ message: "User not found" });

How do I fix 404 errors in an Angular SPA?

In Angular with routing, all URLs should serve index.html and let Angular router handle navigation. Configure your server: nginx: try_files $uri $uri/ /index.html; Apache: FallbackResource /index.html; Express: app.get("*", (req, res) => res.sendFile(path.join(__dirname, "dist/index.html")));. Without this, direct URL access or page refresh causes a server-level 404.

What is a custom 404 page and how do I set one up?

A custom 404 page provides a helpful message when a URL does not exist, rather than a generic browser error. In nginx: error_page 404 /404.html; and serve 404.html. In Express: app.use((req, res) => res.status(404).render("404")). In Angular: add a ** (wildcard) route pointing to a PageNotFoundComponent as the last route in your routing config.

You might also like

Related Tools