SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. 4xx Client Error
  3. 404 Not Found

404 Not Found

🔍
404
Not Found
!
?

Example HTTP Response

HTTP Response
HTTP/1.1 404 Not Found
Content-Type: application/json

{"error": "Resource not found"}
Common Causes
  • Typo in URL
  • Page was deleted
  • Link is outdated
Technical Details

What does this mean?

The internet's version of 'I looked everywhere and it's just not here!' Like searching for your keys in an empty pocket.

Technical Definition

The server cannot find the requested resource. The URL is not recognized.

RFC Says

"The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists."

Plain English:

Either the resource genuinely doesn't exist at this URL, or the server is pretending it doesn't exist (for security or privacy reasons).

"A 404 status code does not indicate whether this lack of representation is temporary or permanent."

Plain English:

404 doesn't tell you if the resource will exist in the future or existed in the past. If you want to explicitly say 'this was deleted permanently', use 410 (Gone) instead.

Common Misinterpretation

Some developers use 404 for authorization failures to hide the existence of resources. While the RFC allows this ('not willing to disclose'), it's usually better to use 403 (Forbidden) when a resource exists but the user lacks access, as it provides clearer feedback to legitimate users.

View RFC Documentation
Code Snippets

Ready-to-use code for returning this HTTP status in your application:

Node.js
// Express.js
app.get('/example', (req, res) => {
  res.status(404).json({
    error: 'Not Found',
    message: 'Your error message here'
  });
});

// Native HTTP
const http = require('http');

http.createServer((req, res) => {
  res.writeHead(404, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'Not Found',
    message: 'Your error message here'
  }));
}).listen(3000);
When to Use This Code
  • Resource doesn't exist at this URL
  • When you don't want to reveal if a resource ever existed
  • Use 410 Gone if the resource was explicitly deleted
  • Use 403 if resource exists but user can't access it
SEO Handling

Indexing

404 pages are not indexed. Google removes previously indexed URLs that start returning 404, though this may take time.

Crawler Behavior

Crawlers reduce crawl frequency for 404 URLs over time. Persistent 404s are eventually dropped from Google's crawl queue.

Canonical URL Notes

If you've moved content, use 301 redirect instead of 404. This preserves SEO value and guides users to the new location.

Google Notes

Google distinguishes between soft 404s (page says 'not found' but returns 200) and hard 404s. Always return proper 404 status.

Google Search Documentation →
From the Blog
  • Understanding HTTP 404 Not Found: Why It Happens and What to Do About It

    The internet's most famous error explained — what 404 really means, when to use it vs. 410 or 403, how it affects SEO, and how to build a 404 page that doesn't lose users.

    10 min read
Related Status Codes
👻410Gone⚖️451Unavailable For Legal Reasons
Commonly Confused With
👻410Gone

404 Not Found FAQ

What causes a 404 Not Found error?

Typo in URL. Page was deleted. Link is outdated.

When should I use 404 Not Found?

Resource doesn't exist at this URL. When you don't want to reveal if a resource ever existed. Use 410 Gone if the resource was explicitly deleted. Use 403 if resource exists but user can't access it.

403 Forbidden405 Method Not Allowed

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes →

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

© 2026 SiteError.com. All rights reserved.