DevTools Logo

robots.txt Matcher & Tester

robots.txt Matcher & Tester

Paste robots.txt and URLs to see the exact rule, line and per-crawler verdict. Implements the REP / Google matching algorithm.

Runs in your browser
Try an example

robots.txt + URLs

10 lines · 164 chars · 6 URLs
Load a fixture:

Verdicts

6 results · 0 errors
URLVerdictMatched ruleLine
https://example.com/admin/pageDisalloweddisallow: /admin/
https://example.com/admin/widgetsAllowedallow: /admin/widgets
https://example.com/manuals/guide.pdfDisalloweddisallow: /*.pdf$
https://example.com/manuals/guide.pdf?download=1AllowedNo match (default allow)—
https://example.com/public/notesAllowedNo match (default allow)—
https://example.com/robots.txtAllowedNo match (default allow)—

Effective rules & match badges

3 rules · exact group

Crawler Googlebot: Exact user-agent match 'googlebot'. Badges below test /admin/page.

  • MatchDisallow: /admin/
  • No matchAllow: /admin/widgets
  • No matchDisallow: /*.pdf$

Parser warnings & notes

0 notices · 1 sitemap

Crawl-delay: not declared — parsed for reference only; Google ignores it.

Sitemaps: https://example.com/sitemap.xml — recorded, never fetched or validated live.

No parser warnings. Rules were parsed cleanly.

Verdicts simulate the documented REP / Google algorithm; other crawlers may interpret rules differently.

Authoring a new file instead? Open the robots.txt Generator.

Details

Google retired its own robots.txt tester, but verifying crawl directives is still a recurring SEO job. Paste a robots.txt file and one or more URLs to see which group applies to a simulated crawler, which allow or disallow rule wins, and the exact line number behind each verdict. The matcher implements the documented REP / Google algorithm: user-agent groups are selected by exact match, then longest prefix, then the `*` fallback; repeated groups for the same agent are combined; patterns are anchored at the start of path + query; wildcards `*` and `$` work as documented; the longest rule path wins and ties go to Allow. Every result carries a trace of candidate matches with their specificity, plus warnings for empty Disallow values, duplicate rules, orphan rules and unknown directives. Compare Googlebot, Googlebot-Image, Bingbot, DuckDuckBot, GPTBot, a custom token or a whole crawler matrix. Everything runs in your browser: no robots.txt is uploaded and no URL is fetched, so verdicts are simulations rather than live crawler observations.

More examples

Longest match overrides a broad block

User-agent: *
Disallow: /

User-agent: Googlebot
Disallow: /admin/
Allow: /admin/widgets

URL: https://example.com/admin/widgets
Result: Allowed — Allow: /admin/widgets (line 6)

Googlebot uses its specific group, and the longer Allow rule wins over the shorter Disallow rule.

Wildcards and the end anchor

User-agent: *
Disallow: /*.pdf$

URLs: /manual.pdf → Disallowed
       /manual.pdf?download=1 → Allowed
       /manual.pdf5 → Allowed

The trailing $ anchors the rule to the end of path + query, so query strings and longer suffixes no longer match.

User-agent group precedence

user-agent: googlebot-news
disallow: /fish

user-agent: *
disallow: /carrots

Googlebot-News on /fish → Disallowed
Otherbot on /carrots → Disallowed
Googlebot on /fish → Allowed

The most specific matching user-agent group applies regardless of file order; all other crawlers fall back to the wildcard group.

Empty Disallow warning

User-agent: *
Disallow:
Disallow: /private/

URL: / → Allowed (warning on line 2)
URL: /private/x → Disallowed (line 3)

An empty Disallow value is ignored by crawlers; the tool explains the warning instead of silently blocking the whole site.

    Examples

    Longest rule path wins

    Input
    User-agent: Googlebot
    Disallow: /admin/
    Allow: /admin/widgets
    
    URL: /admin/widgets
    Output
    Allowed
    Winner: allow: /admin/widgets (line 3), specificity 14
    Other candidate: disallow: /admin/ (line 2), specificity 8

    Both rules match, but the longer rule path decides the verdict.

    Allow wins an exact tie

    Input
    User-agent: *
    Allow: /folder
    Disallow: /folder
    
    URL: /folder/page
    Output
    Allowed
    Winner: allow: /folder — equal specificity, Allow wins the tie.

    Google applies the least restrictive rule when conflicting rules have equal specificity.

    End anchor and query strings

    Input
    User-agent: *
    Disallow: /*.pdf$
    
    URLs: /manual.pdf, /manual.pdf?download=1
    Output
    /manual.pdf → Disallowed (line 2)
    /manual.pdf?download=1 → Allowed (no match)

    The $ anchor matches the end of path + query, so a query string prevents the match.

    Group selection across crawlers

    Input
    user-agent: googlebot-news
    disallow: /fish
    
    user-agent: *
    disallow: /carrots
    
    URL: /fish, crawlers Googlebot-News and Googlebot
    Output
    Googlebot-News → Disallowed via line 2
    Googlebot → Allowed (wildcard group only blocks /carrots)

    Only the most specific matching group applies; a related crawler token is not a match.

    About this tool

    robots.txt Matcher & Tester answers the question a robots.txt generator cannot: given these exact rules, will a crawler fetch this URL? Paste a robots.txt file and one or more URLs to see an allow/disallow verdict, the winning directive, its line number, and a ranked trace of every rule that matched. Switch the simulated crawler to Googlebot, Googlebot-Image, Bingbot, DuckDuckBot, GPTBot, a custom token or `*` to see how group selection changes the answer.

    The matcher implements the documented REP algorithm from RFC 9309 and Google's published interpretation. Consecutive user-agent lines form one group; groups that match the same crawler at the same specificity are merged in file order. An exact user-agent match beats a prefix match, and only `*` groups are used as a fallback. Patterns are anchored at the first octet of path + query, `*` matches any run of characters and a trailing `$` anchors the end of the URL. The longest canonical rule path wins; when rules tie, Allow wins because Google uses the least restrictive interpretation.

    Before comparison, raw UTF-8 rule paths and URL paths are canonicalised to percent-encoded form, percent-encoded unreserved octets are decoded, and uppercase hex is used throughout. That makes `Disallow: /café` and `Disallow: /caf%C3%A9` equivalent while keeping `%2F` distinct from a real slash. Parser warnings flag empty Disallow values, rules before the first user-agent, duplicate rules, unknown directives, invalid crawl-delay values and content past Google's 500 KiB limit. All matching happens locally in the browser; no file is uploaded and no URL is fetched.

    What this tool does not do

    • Verdicts simulate the documented REP / Google algorithm; Google's internal implementation and other crawlers may rank wildcard matches differently.
    • No HTTP request is made: live robots.txt fetching, redirects, status-code handling, caching and sitemap availability are out of scope.
    • Page-level blocking via meta robots or X-Robots-Tag is not evaluated; only robots.txt rules are matched.
    • The 500 KiB size limit is applied to pasted text; the tool cannot reproduce Google's cache, crawl timing or per-crawler variants.
    • Share links are capped at roughly 1.6 KB of encoded state because browsers limit URL length; larger configurations can be exported as CSV instead.
    • Batch evaluation is capped at 5,000 URLs to keep the browser table responsive.

    How to use this tool

    1. Paste or upload robots.txt

      Drop in the file from your site root, upload a .txt file, or load one of the built-in fixtures. Line numbers in the verdicts refer to the pasted text.

    2. Add URLs

      Enter one absolute URL, /path or hostname per line. Fragments are ignored; query strings take part in matching. Press Enter or add lines to build a batch.

    3. Pick a crawler

      Choose a preset or type a custom product token. Exact user-agent matches win, then longest prefix matches, then the * group.

    4. Read the verdict and trace

      Click a result row to expand the ranked candidate matches with rule-path specificity and matched-character counts. The effective-rules panel shows match badges for every rule in the selected group.

    5. Compare and export

      Turn on Compare crawlers for an all-agents matrix, copy or download the verdict CSV, or copy a share link when the configuration is small enough to fit in a URL.

    Use cases

    Audit a robots.txt change

    Paste the old and new file into two runs and compare the verdict table before deploying a change that could deindex a section.

    Explain a missing snippet

    A page is indexed without a snippet? Test its URL with Googlebot to see which Disallow rule prevents crawling.

    Verify AI-crawler opt-outs

    Switch the crawler to GPTBot or ClaudeBot and confirm that a block rule applies to those tokens without affecting Googlebot.

    Debug wildcard rules

    Test a set of paths against /*.pdf$ or /fish*.php and read the trace to see exactly why a URL matches or does not.

    Matching semantics implemented by this tester

    ElementBehavior
    User-agentCase-insensitive product token. Exact match beats longest prefix match; otherwise the * group applies. Repeated matching groups are merged in file order.
    Allow / DisallowRoot-relative path values; field names are case-insensitive but values are case-sensitive. An empty value is ignored (with a warning).
    * wildcardMatches zero or more characters, including slashes. A trailing wildcard behaves like a prefix match.
    $ anchorOnly a trailing $ anchors the end of path + query. A literal dollar sign in a rule must be written %24.
    Percent-encodingUTF-8 paths are percent-encoded, escapes use uppercase hex, and %41 decodes to A. Reserved escapes such as %2F, %20 and %2A stay encoded.
    SpecificityThe canonical rule-path length decides the winner. Equal lengths go to Allow; with no match, crawling is allowed by default.
    Crawl-delay / SitemapParsed and reported for reference only. Google ignores crawl-delay, and sitemap URLs are neither fetched nor validated.

    /robots.txt itself is implicitly allowed under RFC 9309, even when a rule disallows the whole site.

    Common mistakes

    Mistake:Writing `Disallow:` with no path to mean 'block everything'.

    Fix:Google ignores rules without a path, so that line allows everything. Use `Disallow: /` and check the warning the tool shows.

    Mistake:Assuming the first matching rule or the last rule in the file wins.

    Fix:Google ranks all matching rules by canonical rule-path length; ties go to Allow. The trace shows every candidate ranked by specificity.

    Mistake:Expecting a Googlebot group to also cover Googlebot-Image.

    Fix:User-agent matching is token-based: googlebot is a prefix of googlebot, but not of googlebot-image. Use Compare crawlers to spot these gaps.

    Mistake:Treating a trailing query string as irrelevant to matching.

    Fix:The URL's path and query are compared together, so `Disallow: /*.pdf$` does not match `/file.pdf?download=1`.

    Frequently asked questions

    Which rule wins when Allow and Disallow both match?

    Google ranks matching rules by the length of the canonical rule path, not by their order in the file. The longest rule path wins. If an Allow and a Disallow rule have the same length, the less restrictive Allow rule wins — for example `Allow: /folder` and `Disallow: /folder` on `/folder/page` result in Allowed. The tool shows every candidate with its specificity so you can see why a verdict was reached.

    How do the wildcards * and $ work?

    An asterisk matches zero or more characters including slashes, so `Disallow: /*.php` matches `/index.php`, `/folder/x.php?y=1` and `/a.php.file.html`. A dollar sign is only an end anchor when it is the last character of the rule: `Disallow: /*.pdf$` matches `/manual.pdf` but not `/manual.pdf?download=1`. To match a literal asterisk or dollar sign in a URL, percent-encode it as %2A or %24 in the rule.

    Does case matter in robots.txt paths?

    Field names (`User-agent`, `Allow`, `Disallow`, `Sitemap`) and user-agent values are case-insensitive, but path values are case-sensitive. `Disallow: /Admin/` does not match `/admin/`. Percent-escapes are canonicalised to uppercase hex, so `%2f` and `%2F` compare identically, while `%2F` is not the same as a real slash.

    How are user-agent groups selected?

    A crawler uses the single most specific matching group: an exact product-token match beats a prefix match, and a prefix match beats the `*` fallback. File order does not matter. If several groups match at that same best specificity, their rules are merged in file order. A `Googlebot` group therefore does not apply to `Googlebot-Image`, and a related but non-matching crawler falls back to `*`.

    Does a Sitemap line affect crawling?

    No. Sitemap records are global hints that help crawlers discover URLs; they are not tied to a user-agent and do not allow or disallow anything. They also do not end a group: a Sitemap line between `User-agent: a` and a rule leaves that rule attached to group a. This tester records sitemap URLs for reference but never fetches or validates them.

    Why is an empty `Disallow:` not blocking my whole site?

    Crawlers ignore allow and disallow rules with no path. `Disallow:` leaves everything crawlable; you need `Disallow: /` to block the site. The tester flags the empty value with a line-numbered warning so this common typo does not slip through an audit.

    Is /robots.txt itself subject to Disallow: /?

    No. RFC 9309 states that /robots.txt is implicitly allowed so crawlers can keep checking for updated rules. This tester always reports Allowed for that path and notes the implicit rule in the trace, even when a broad Disallow would otherwise match it.

    Are my robots.txt and URLs uploaded or fetched?

    No. Parsing, matching and the crawler matrix run entirely in your browser tab. The tool never requests your robots.txt, the tested URLs or a sitemap, which also avoids SSRF concerns. Because a real crawler can cache rules or interpret wildcards differently, verdicts are simulations — use Compare crawlers and read the trace before treating a result as a live Googlebot observation.

    References & standards