ads.txt Validator

Paste your ads.txt content to check its syntax instantly. Validates the DOMAIN, PUBLISHER_ID, and RELATIONSHIP (DIRECT/RESELLER) fields line by line, helping you correctly set up the file that guards against unauthorized ad inventory reselling (domain spoofing).

What is ads.txt?

ads.txt (Authorized Digital Sellers) is a plain text file that lets site owners declare which advertising systems are authorized to sell their ad inventory. It is an industry standard developed by the IAB Tech Lab, and it is meant to be hosted at the root of your domain (for example, https://example.com/ads.txt). Each line follows a strict format of three or four comma-separated fields — DOMAIN (the ad system's domain), PUBLISHER_ID (your account identifier with that system), and RELATIONSHIP (either DIRECT or RESELLER) — and even a single misplaced character can cause an ad system's crawler to fail the match, leaving otherwise legitimate inventory flagged as unauthorized.

This validator parses the ads.txt content you paste in line by line and flags problems such as an incorrect number of fields, empty fields, malformed DOMAIN values, and misspelled RELATIONSHIP values (anything other than DIRECT or RESELLER). It also correctly recognizes comment lines that start with # and variable directives such as CONTACT=, SUBDOMAIN=, INVENTORYPARTNERDOMAIN=, OWNERDOMAIN=, and MANAGERDOMAIN=, listing them separately from record lines so you can see exactly what each entry is doing. You can also fetch and check the live ads.txt file from any URL instead of pasting content by hand, which is handy for auditing a site you already manage.

How to use the ads.txt validator

  1. Prepare your ads.txt content Have the current file from your own site ready, or draft the content you are planning to publish, as plain text you can copy.
  2. Paste it in or fetch it from a URL Paste the text directly into the input box, or enter a domain in the "Fetch from URL" field to pull an existing site's live ads.txt file automatically.
  3. Review the validation results Check the line-by-line table to see whether each line was classified as valid, an error, a variable directive, or a comment.
  4. Fix any flagged lines Rewrite the problem lines based on the specific reason shown in the note column, such as a missing field or an invalid domain format.
  5. Publish the corrected file at your domain root Once every line shows as valid, upload the file to your server so it is reachable at https://yourdomain.com/ads.txt.

Tips for getting more out of it

  • The basic format has 3 fields — DOMAIN, PUBLISHER_ID, and RELATIONSHIP — with an optional 4th field for the certification authority ID. Count the commas to check nothing is missing or extra.
  • RELATIONSHIP only accepts DIRECT (the site owner has a direct contract) or RESELLER (sold through a reseller). It is case-insensitive per spec, but uppercase is the conventional style.
  • Lines starting with # are ignored as comments. Adding variable directives like CONTACT= or OWNERDOMAIN= helps ad systems cross-check your account.
  • ads.txt must be hosted at the domain root (https://example.com/ads.txt). Placing it in a subdirectory means ad systems and crawlers won't recognize it.
  • There is a companion spec for mobile apps called app-ads.txt. If you sell ad inventory on both a website and a mobile app, you need to host both files.

When this tool comes in handy

Pre-checking before an AdSense review

Verify that your published ads.txt has no syntax mistakes ahead of an AdSense application or when trying to resolve an ad-serving warning tied to it.

Adding a new SSP or ad network

When a new supply-side platform sends you a line to add to your file, confirm the comma count and field order are correct before you deploy the change to production.

After a CMS migration or site redesign

Use the URL fetch feature to check the live file directly on the production domain after a WordPress migration or server move, since encoding and line-break issues are common there.

Auditing multiple domains at once

Agencies and publishers managing several properties can use this as a quick validation step while auditing the ads.txt files across their whole portfolio.

Checking a snippet before merging it in

Run a syntax check on a snippet an ad network emailed you, on its own, before you paste it into your live file and risk breaking existing entries.

Glossary

ads.txt
A text file specification created by the IAB Tech Lab for declaring the authorized sellers of a site's ad inventory. It must be hosted at the domain root.
DIRECT
A RELATIONSHIP value indicating that the site owner has a direct contract with the ad system and holds the authority to sell that inventory themselves.
RESELLER
A RELATIONSHIP value used when a reseller, such as an ad network, sells the inventory on the owner's behalf under delegated authority.
Certification Authority ID
An optional fourth field identifying the ad system with an ID issued by a body such as TAG (Trustworthy Accountability Group).
Domain spoofing
A fraudulent practice where a third party copies and resells legitimate ad inventory without permission, tricking advertisers into buying placements on a different site. ads.txt was created specifically to stop this.
Authorized Digital Sellers
The full name behind the "ads.txt" abbreviation, capturing the specification's core idea of publicly listing verified, authorized sellers.
PUBLISHER_ID
The account identifier issued by each ad system. On Google AdSense, this is the string that starts with "pub-".
SSP (Supply-Side Platform)
An intermediary platform that connects a publisher's ad inventory to advertiser bidding systems. Its domain is what appears in the ads.txt DOMAIN field.

Frequently Asked Questions

Ad delivery won't stop immediately, but Google flags sites that lack a correctly configured ads.txt, and leaving it unaddressed can lead to part of your ad inventory no longer being sold. Check the ads.txt snippet for your site in the AdSense dashboard and host it at your domain root.

DIRECT means the site owner has a direct contract with the ad system and holds the authority to sell that inventory. RESELLER is used when a reseller (such as an ad network) sells the inventory on the owner's behalf, with delegated authority. If a single ad slot is sold through multiple ad systems, each relationship must be listed correctly.

It's the account-specific ID issued by each ad system (Google AdSense, Google Ad Manager, other SSPs, etc.). For AdSense it is a string starting with "pub-", which you can find on the account settings page or via the ads.txt snippet feature in the dashboard.

It varies by ad system and crawler, but it is commonly refetched within 24 hours. Since it can take a while for changes to propagate, don't worry if your ad delivery doesn't change immediately after an update.

In principle, ads.txt is independent per domain, and a subdomain does not inherit the settings from the root domain. However, the IAB spec includes a SUBDOMAIN= directive that lets you point specific subdomains to a separate file.
Tool-kun

Side Note — Why ads.txt exists: an industry standard against ad inventory "spoofing"

ads.txt (Authorized Digital Sellers) is a specification created in 2017 by the IAB Tech Lab. At the time, programmatic advertising was plagued by "domain spoofing" — fraudsters copying and reselling legitimate publishers' ad inventory without authorization. Advertisers thought they were bidding on a premium site, but their ads ended up on unrelated, low-quality pages instead, eroding trust for both advertisers and publishers.

The mechanism is simple: a publisher lists, at the root of its domain, the advertising systems it has authorized to sell its inventory, as a plain text file. Ad buying systems fetch this file and verify whether the inventory they are bidding on is really being sold through a channel the domain has officially approved. Because the design is so simple, adoption cost is low, and within a few years the majority of major ad systems and publishers had embraced it as an industry standard.

Google AdSense has also promoted ads.txt adoption since 2019, and sites without it correctly configured may see part of their ad delivery restricted. For a site whose business model runs on ad revenue, ads.txt is not just a recommendation — it is effectively a required setting to protect that revenue.

Companion specs from the IAB Tech Lab include app-ads.txt for mobile apps and sellers.json, which publishes information about sellers on the ad-system side. Together, they let advertisers verify who is selling which inventory and under what relationship across the entire supply chain.