Free Tool — Runs In Your Browser

Robots.txt Generator and Rule Tester

Build a robots.txt file, check which rule wins for any URL, then copy it or download it as UTF-8. Nothing you type leaves this page.

A bare host adds /sitemap.xml. A URL with a path is used as the sitemap as given.

Start from
Add crawler presets

Templates replace the groups below. Presets add groups and skip user-agents you already have.

Group 1
User-agent: *
Disallow: /admin/
Disallow: /api/

Where it goes in your repo: save it as public/robots.txt (Next.js, Vite, Astro, Remix) so it is served at /robots.txt on the root of the host. Commit it and open a pull request. Deployment and testing steps are in the robots.txt guide.

Checks (1)

  • Note: No Sitemap line: enter your host or sitemap URL to add one.

Test a URL against these rules

Enter a path to see which rule applies.

What this robots.txt generator does

It writes a robots.txt file from the groups you fill in: one User-agent per group, its Allow and Disallow paths, an optional Crawl-delay, and absolute Sitemap lines. The file updates as you type, and paths that are malformed are left out with a message saying why.

How to use it

Enter your host, pick a template, add presets for the search or AI crawlers you want to allow or block, and edit the paths. Then type a URL into the tester to see whether a crawler may fetch it. Copy the result, or download it as a UTF-8 robots.txt file, and add it to your repository.

How the rule test works

The tester picks the group with the most specific user-agent, falling back to *. It collects every Allow and Disallow path that matches the URL, supports * and a trailing $, and picks the longest match. On a tie, Allow wins. It checks your rules only; it does not fetch your live file.

Questions

Is this robot txt maker free?

Yes. It needs no account and no API key, and it runs in your browser, so the paths and URLs you type are never sent to a server.

Which rule wins when Allow and Disallow both match?

The longest matching path wins. If an Allow and a Disallow match with the same length, Allow wins. The tester shows the winning line and the rules it beat.

Does robots.txt keep a page out of Google?

No. It controls crawling, not indexing, and a blocked URL can still be indexed from links. To keep a page out of results, use a noindex meta tag or X-Robots-Tag header and leave the page crawlable.

Where do I put the file?

At the root of the host, so it is served at /robots.txt. In a Next.js, Vite or Astro repo that means public/robots.txt, or an app/robots.ts file in Next.js. Commit it and merge it like any other change.

For deployment, testing in Search Console and the mistakes that deindex pages, read how to create a robots.txt file online. SEOAgent installs as a GitHub App, audits your site's code, and opens a pull request with the fix, including robots.txt changes, for you to review and merge. More free checkers are on the tools page.

SEOAgent for GitHub

Your first SEO pull request in about 5 minutes.

Connect the repo your site lives in. SEOAgent finds what holds the site back in search and fixes it in pull requests. You review and merge every change.

  • 14 days free
  • No card
  • $79/site/month after
OpenExample
Set up SEOAgent
  • What SEOAgent found, and the plan for your site
  • Meta descriptions for 14 pages
  • Sitemap and robots.txt
  • Organization schema
+412 −3 · 9 files · Checks passed
  • 370+sites
  • 1,100+articles written
  • 3,500+SEO changes made