Robots.txt & Ads.txt Validator
Check that robots.txt is not silently blocking Google or AdSense, and generate a correctly formatted ads.txt line. Runs entirely offline — nothing you paste here is uploaded or stored.
Found in AdSense > Account > Settings > Publisher ID.
Nothing you paste here leaves your browser. This tool makes no network requests of any kind.
This robots.txt validator checks the crawler rules that most webmasters never think to verify: whether Googlebot and, specifically, the Mediapartners-Google crawler can actually read your pages. A robots.txt file that accidentally blocks Mediapartners-Google does not throw an error anywhere - it just quietly caps your AdSense earnings, because Google cannot read the page content well enough to serve relevant ads. Paste your file and the checklist confirms a wildcard user-agent rule, explicit Mediapartners-Google access, that the root path is not disallowed, and that a sitemap is declared.
The second tab generates a correctly formatted ads.txt line from your AdSense Publisher ID, checking the domain, ID format, DIRECT relationship and Google's certification authority ID before you copy it. Everything runs locally in your browser; your publisher ID and robots.txt contents are never sent anywhere.
It does not fetch your live robots.txt or ads.txt for you - paste the content you want to check, and it validates the syntax and rules against Google's documented requirements.
How to Use Robots & Ads.txt Validator
- Paste your robots.txt — Copy the contents of your live /robots.txt file into the text box, or start from the example.
- Review the checklist — Each rule is marked passed or failed with a plain-language explanation of what it means for crawling.
- Fix the Mediapartners-Google rule if it fails — Add a User-agent: Mediapartners-Google block with Allow: / so AdSense can read your pages.
- Switch to the ads.txt tab — Enter your AdSense Publisher ID to generate a correctly formatted ads.txt record.
- Copy and publish — Paste the generated line into your site's root /ads.txt file and redeploy.
Frequently Asked Questions
Why does robots.txt matter for AdSense specifically?
AdSense uses a separate crawler, Mediapartners-Google, to read your page content and choose relevant ads. If your robots.txt blocks that user-agent, or blocks the whole site, AdSense falls back to generic ads or shows none at all, quietly reducing your revenue with no error message anywhere in your dashboard.
What does a correct ads.txt line look like?
A standard Google AdSense record reads: google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0. The four fields are the ad system domain, your 16-digit publisher ID, the relationship type (DIRECT means you manage the inventory yourself), and Google's certification authority ID, which is the same fixed value for every AdSense publisher.
Where do I find my AdSense Publisher ID?
Sign in to Google AdSense, open Account in the left menu, then Settings, and your Publisher ID is listed there in the format pub- followed by 16 digits. It is also visible in the ad code snippet AdSense gives you to paste into your site.
Does this tool fetch my live robots.txt automatically?
No. You paste the content yourself, either from your site's live /robots.txt file or from a draft you are testing before deployment. This keeps the tool fully offline and means it works for files that are not published yet.
Is my publisher ID or robots.txt content ever sent to a server?
No. Every check runs as plain JavaScript inside your browser tab. There are no network requests of any kind, so it is safe to test a robots.txt file or publisher ID you have not published publicly yet.