Using the Robots.txt Validator
The Robots.txt Validator checks text you paste. The sample is two lines: User-agent: * and Disallow: /admin. Choose Check robots.txt. The headline is Valid. The label above the headline reads robots.txt. The sentence under the headline is 2 directives are valid, including 1 User-agent lines. The detail lines are Directives 2 and User-agent lines 1. Those two numbers are the whole result. The page counts kept lines. It does not rewrite the paste, and it does not fetch a host to compare the paste with a file that already exists somewhere else.
A blank line is skipped. A line that is only spaces is skipped after the spaces are trimmed. A line whose first character, after trimming, is # is a comment and is skipped. The sample has no comment and no blank line, so both lines are kept and the directive count is 2. Put a blank line between the two sample lines and the count stays 2. Put a line that starts with # above them and the count stays 2. The comment is not a directive. The headline stays Valid, and the User-agent count stays 1, because only one kept line begins with User-agent.
Each kept line must start with one of five field names, then a colon, then a value. The names are User-agent, Disallow, Allow, Sitemap, and Crawl-delay. The match ignores letter case, and spaces are allowed around the colon. The value must begin with a character that is not a space. User-agent: * meets that rule because the asterisk is a value. Disallow: /admin meets it because the path is a value. A line that fails the rule stops the check. The headline becomes the rejection, and there is no Valid count to read. The sample passes because both lines name a known field, include a colon, and include a value, and one of them is a User-agent line.
The paste must contain from 1 to 20000 characters. An empty box is rejected before any line is read. A paste longer than 20000 characters is rejected with the same message. At least one kept line must be a User-agent line. A paste that is only Disallow: /admin is rejected, even though that line is a known field, because the User-agent count is 0. The page does not fetch the paths or the sitemap addresses written in the paste. Valid means the kept lines passed these checks. It does not mean a crawler was asked to read a host.
What Valid and the Two Counts Mean
Valid is the headline for a paste that passed. For the sample, the sentence under it says 2 directives are valid, including 1 User-agent lines. Directives is the number of kept lines. User-agent lines is how many of those kept lines begin with User-agent. The sample keeps both lines, and only the first begins with User-agent, so the detail lines read Directives 2 and User-agent lines 1. The wording of the sentence uses lines even when the User-agent count is 1. That is the sentence the page writes. It is not a second file.
The counts follow the paste. Add a third kept line, such as Allow: /, and a successful check reports 3 directives, still with 1 User-agent line, as long as the first two lines remain the sample. Add a second User-agent line and both counts rise. Comments and blank lines never enter either count. A rejection replaces the headline. You do not get a partial count beside an error. Fix the line the message is about, or add the User-agent line, and check again.
How a Line Is Kept or Skipped
The page splits the paste on line breaks and trims each line. An empty line is skipped. A line that starts with # is skipped. Every other line is tested. The test asks whether the line begins with User-agent, Disallow, Allow, Sitemap, or Crawl-delay, whether a colon follows, and whether a value follows the colon. Spaces may sit around the colon. User-agent: * passes. user-agent: * passes, because the field name is matched without regard to case. Disallow: /admin passes. A line that passes adds 1 to the directive count. If that line begins with User-agent, it also adds 1 to the User-agent count. A line that fails stops the check immediately with Each line needs a robots.txt field and a value.
Building a short file from separate fields is a different page. The Robots TXT Generator writes User-agent, Disallow, and optional Allow and Sitemap lines from fields you fill. The sample there can be four lines, and an empty allow or sitemap field omits that line. That page does not upload the file. Use it when you want lines written for you. Use this page when you already have the text and want the directive count and the User-agent count.
What the Check Does Not Fetch
The page does not fetch a host. Disallow: /admin in the sample is a line that passed the field test. It is not a report that a crawler was turned away, and it is not a request sent to a server. Sitemap is accepted when the line names Sitemap, includes a colon, and includes a value. The page does not open that value. Allow and Crawl-delay are counted the same way. A Crawl-delay line needs a value, and the page does not require that value to be a number. The check is the field name, the colon, and a value that starts with a visible character.
The page also does not decide which line a crawler would honor if both Allow and Disallow appear. It does not group lines under the nearest User-agent. It does not compare the paste with a file on a server. Two kept lines in the sample produce the headline Valid and the counts 2 and 1. A longer paste that still follows the rules produces a larger directive count. The meaning of the paths stays in the text you pasted.
The Sample Paste and a Comment
Paste the two sample lines, User-agent: * and Disallow: /admin, and choose Check robots.txt. The headline is Valid. The sentence reports 2 directives, including 1 User-agent line. The detail lines match those numbers. Check the same two lines again. The headline and the counts stay the same. Insert a blank line between them and check. The counts stay 2 and 1, because the blank line is skipped. Put # sample above the two lines and check. The counts stay 2 and 1, because a line that starts with # is skipped. The comment is not listed as a directive.
A sitemap file is a different paste. The Sitemap Validator checks sitemap XML you paste. A urlset with one https loc is 1 URL. That page does not fetch the addresses. Use it when the text is a sitemap. Use this page when the text is robots.txt lines and you want the directive count, including the sample pair User-agent: * and Disallow: /admin.
Fields, Values, and the Length Cap
The paste must be from 1 to 20000 characters. Empty text, and text longer than 20000 characters, is rejected with Enter from 1 to 20000 characters. That check happens before lines are counted. A kept line must use User-agent, Disallow, Allow, Sitemap, or Crawl-delay. Hello is not one of those fields, so a paste whose only line is Hello is rejected with Each line needs a robots.txt field and a value. Disallow with a colon and no value is rejected with that same message, because a value is required. A field name outside the five names is rejected with that same message, even if the line contains a colon and a value.
After the lines pass, the User-agent count must be at least 1. A paste of only Disallow: /admin is rejected with Add a User-agent line. Comments and blank lines do not satisfy that requirement. A comment that mentions User-agent still starts with #, so it is skipped and does not count as a User-agent line. The sample satisfies the requirement with the line User-agent: *. One successful check can contain more than one User-agent line. Each of them adds 1 to both counts.
Lines People Expect the Check to Repair
A common miss is to paste Hello and expect the page to ignore it. Hello is rejected with Each line needs a robots.txt field and a value. Another miss is to paste Disallow: /admin alone and expect Valid with 1 directive. The line is a known field, and it still fails because there is no User-agent line. The message is Add a User-agent line. Another miss is to count a blank line or a # comment as a directive. Both are skipped. Another miss is to expect the page to fetch a host and report whether /admin is blocked there. The page does not fetch a host. Another miss is to treat the headline Valid as a rewritten file. The paste is unchanged. The result is the two counts.
Language tags are a different line check. The Hreflang Validator checks hreflang tags you type, one per line. en is valid there. english is not. That page does not fetch a site. Use it when you are checking language tags. Use this page when you are counting robots.txt fields in text you already pasted.
A Sample, a Comment, and a Rejected Line
Paste User-agent: * and Disallow: /admin. Check. Confirm the headline is Valid, the directive count is 2, and the User-agent count is 1. Add a blank line and a line that starts with # and check again. Confirm the counts are still 2 and 1. Add Allow: / as a third directive and check. Confirm the directive count is 3 and the User-agent count is still 1. Replace the paste with Hello and check. Confirm the headline is Each line needs a robots.txt field and a value. Replace it with Disallow: /admin alone and check. Confirm the headline is Add a User-agent line.
Clear the box and check. Confirm the headline is Enter from 1 to 20000 characters. Restore the two sample lines and check. The headline must read Valid, with 2 directives and 1 User-agent line, before you treat the paste as the sample again. Add Sitemap: https://example.com/sitemap.xml under the sample and check. The directive count becomes 3, the User-agent count stays 1, and the page still does not fetch that address. The extra line is only another kept field with a value.
Saving the Paste With the Counts
Copy the paste and write the two counts beside it. For the sample, the note is User-agent: * , Disallow: /admin, headline Valid, directives 2, User-agent lines 1. If you added a comment or a blank line, write that those lines were skipped so a later count is not expected to rise. If the check was rejected, save the message instead of a count. Hello belongs with Each line needs a robots.txt field and a value. A disallow line with no User-agent line belongs with Add a User-agent line. An empty box belongs with Enter from 1 to 20000 characters. A note that says only Valid can be the sample or a longer file that also passed.
A sitemap address inside the paste is still only a value on this page. Cleaning tracking parameters on a URL is a separate pass. The URL Cleaner removes common tracking parameters from a URL and keeps the rest. A link with utm_source and id keeps id. That page does not open the link. Use it when you want those parameters dropped from a URL. Use this page when you want the robots.txt lines counted.
A Count of the Paste You Typed
The result is a count of kept lines in the paste, plus a count of how many of those lines are User-agent lines. The sample is Valid, 2 directives, and 1 User-agent line. Blank lines and comments that start with # are outside both counts. A kept line needs one of the five field names, a colon, and a value. At least one User-agent line is required. The page does not fetch a host, and it does not rewrite the paste into a new file.
Reading the Counts Before You Keep Them
Start from the sample. User-agent: * and Disallow: /admin should be Valid, with directives 2 and User-agent lines 1. Add a blank line and a # comment and confirm the counts do not move. Add Allow: / and confirm only the directive count moves, from 2 to 3. Paste Hello and confirm the field-and-value message. Paste Disallow: /admin alone and confirm Add a User-agent line. Clear the box and confirm the length message. Then restore the sample and confirm Valid again. The page does not fetch a host during any of these checks.
Structured data for a page is a different block of text. The Schema Markup Generator builds one JSON-LD object from a type, a name, and a description. It does not publish the markup or claim that a search engine will use it. Use that page when you are writing JSON-LD. Use this page when you are checking robots.txt lines you pasted.