Robots.txt Generator and Tester
Build a robots.txt file, check it line by line, and test whether a crawler may visit a page, with the rule that decides shown.
- Free, no sign-up
- Runs in your browser
- Sources cited
Build
* for every crawler, or a product token such as Googlebot.
Starts with /. Use * for any characters and $ for the end, such as /*.pdf$.
Edit directly, paste an existing file, or build it with the controls above.
Test a URL
Check
- Groups
- 2
- Rules
- 4
- Sitemaps
- 1
203 bytes of the 500 KiB crawlers must read.
Tidy file
User-agent: * Allow: /admin/help/ Disallow: /admin/ Disallow: /cart User-agent: Googlebot-Image Disallow: /private-images/ Sitemap: https://www.example.com/sitemap.xml
How to use the robots.txt generator and tester
Start from a preset or your own file
Allow everything, block everything, start from a typical site, or paste the robots.txt you have.
Add rules
Name a crawler, or * for all, enter a path, and add it as Disallow or Allow. Add your sitemap URLs too.
Fix what the check finds
Each problem is listed with its line: misspelled fields, rules before any User-agent, paths without a leading slash, and non-standard lines.
Test URLs
Enter a crawler and a URL to see whether it may be fetched, which line decided, and which group applied.
Publish it
Copy or download the tidy version and put it at the root of your site, such as https://www.example.com/robots.txt.
How robots.txt works
A robots.txt file tells crawlers which parts of a site they may fetch. Its format is standardized in RFC 9309: groups that start with one or more User-agent lines, followed by Allow and Disallow rules for paths. A crawler uses the group whose User-agent matches its name, compared without regard to case; if none does, it uses the group for *; if there is no such group either, everything is allowed.
Within the group, the most specific rule that matches the path wins, meaning the longest one, and when an Allow and a Disallow are equally long, Allow wins. An asterisk matches any run of characters, and a dollar sign at the end means the path must end there, so Disallow: /*.pdf$ blocks every PDF. Crawlers must read at least the first 500 KiB of the file. Sitemap lines can appear anywhere and point to your XML sitemaps.
robots.txt controls crawling, not indexing, and it is a request that well-behaved crawlers follow, not access control. Google explains that a blocked page can still appear in results if other pages link to it; to keep a page out of search results, let it be crawled and use a noindex rule instead. Never rely on robots.txt to hide private content: the file itself is public.
Worked example
The example file has 2 groups and 4 rules. For Googlebot, which no group names, the * group applies. The URL /admin/help/robots matches both Disallow: /admin/ and Allow: /admin/help/; the allow rule is longer, so the page is allowed.
The URL /admin/settings matches only Disallow: /admin/, so it is blocked. The path /files/report.pdf against the rule Disallow: /*.pdf$ is blocked, while /files/report.pdf?page=2 is allowed, because the dollar sign requires the path to end at .pdf.
Understanding the result, and common mistakes
- Blocking CSS and JavaScript. Search engines need them to see pages as visitors do.
- Using Disallow to remove pages from search results. Use noindex, and leave the page crawlable so the rule can be seen.
- Forgetting the leading slash. Paths are matched from the start, so “admin” matches nothing; write “/admin/”.
- Expecting Crawl-delay to work everywhere. It is not part of the standard, and Google does not support it.
- Listing secret paths. Anyone can read robots.txt, so it can point attackers at what you hoped to hide.
Frequently asked questions
Where does robots.txt go?
At the root of the host, as /robots.txt. Each subdomain and protocol has its own file.
Does an empty Disallow block anything?
No. “Disallow:” with no path allows everything for that group.
Does this tool fetch my live robots.txt?
No. Paste the file instead; nothing is fetched or sent, and the test runs in your browser.
Do all crawlers obey robots.txt?
Reputable search engine crawlers do. Others may ignore it, so it is not a security measure.
Sources
- RFC 9309: Robots Exclusion ProtocolRFC Editor · retrieved Nov 14, 2026
- Introduction to robots.txtGoogle Search Central · retrieved Nov 14, 2026
- How Google interprets the robots.txt specificationGoogle Search Central · retrieved Nov 14, 2026
- Block search indexing with noindexGoogle Search Central · retrieved Nov 14, 2026
About these results
- Everything runs in your browser. Nothing is fetched or sent.