What does a 404 on robots.txt mean?

By TechCompare · Updated · How we check

A 4xx answer for robots.txt, except 429, means no restrictions. Google handles 401 and 403 the same way, so a login wall or firewall in front of the file blocks nothing.

A robots.txt that returns 404 isn't an error. It tells crawlers the site has no rules, and they may fetch every page. That's the right answer for a site with nothing to hold back. It also means there's no Sitemap line and no AI crawler rules, because there's no file to hold them.

Topic
Missing robots.txt (404)
Missing file
Category
Missing or broken file
404, 403 and 5xx answers

How it works

RFC 9309 calls this case unavailable: when the server answers that the file isn't there, the crawler may access any resource on the server. Google's documentation says that for 4xx codes other than 429, it assumes there are no crawl restrictions. The tester follows that. It shows the status, says no robots.txt was found, and lists every crawler as allowed. The 4xx range is wider than 404, and that's the trap. A firewall or login that answers 403 for bots doesn't protect the pages, it only hides your rules. A page that answers 200 with a friendly not found message in HTML is read as a robots.txt full of lines that aren't rules, and the tester marks those lines as ignored. A 5xx answer and 429 read very differently. See the page on server errors for those.

Verdict

You don't need a robots.txt just to avoid the 404. Add one when you have something to say, like a Sitemap line or a block for a crawler. And check that it returns 200 or 404 and not a server error, which gives the opposite result.

More Robots.txt scenarios

Block GPTBot
Two lines tell OpenAI's training crawler to stay out. Its search crawler and its page visits use other names.
View details
Google-Extended
A token for Gemini training, not a crawler. A rule for it never reaches Googlebot or Google Search.
View details
Block AI, keep search
Name each training crawler, leave Googlebot and Bingbot alone, and choose on purpose about the AI search bots.
View details

Frequently asked questions

Does a missing robots.txt hurt SEO?
Not by itself. Google treats a missing file as no restrictions and crawls the site. The file matters when you want to block a path, opt out of a crawler or point to a sitemap.
My robots.txt returns 403 to bots. Is the site blocked?
Not according to Google's documentation. A 4xx answer other than 429 is handled as if the file didn't exist, so Google assumes there are no crawl restrictions. The 403 hides your rules instead of enforcing them.
Should I serve an empty file instead of a 404?
Either works. A 200 with an empty body is a file with no rules, and a 404 is no file. Both let crawlers fetch everything.