The 404 Not Found status code is an HTTP response sent by a server when the requested resource cannot be found. It means the server is reachable, but the specific URL or file does not exist.
When a browser requests a URL, the server searches for the requested resource. If it cannot locate the file or route, it responds with status code 404.
// Example of sending a 404 response using Node.js
res.status(404).send("Page not found");
// PHP example for returning a 404 status code
http_response_code(404);
echo "404 - Page Not Found";
The browser displays a 404 error page. This may be a default server page or a custom-designed error page created by the developer.
Use the simulator below to send requests to a fake server and see the status code response:
// Visiting a missing route like this will trigger a 404
https://example.com/this-page-does-not-exist