How to Validate an ads.txt File for IAB Compliance

Learn how ads.txt works, how DIRECT and RESELLER records differ, what domains and IDs must look like, and how to catch common formatting errors before go-live.

By Generatr Team

ads.txt is a plain-text authorization list publishers place on their domains so buyers can see which companies are allowed to sell that inventory. When the file is wrong, authorized resellers look unauthorized, and unauthorized sellers can look legitimate — both outcomes cost revenue and trust.

This guide covers the IAB Tech Lab record shape, DIRECT versus RESELLER, domain and account ID fields, comments, and the formatting mistakes that fail crawlers. Paste or review your file with the free ads.txt validator — IAB-oriented record checks, DIRECT/RESELLER validation, and domain checks with private client-side processing.

You will leave able to read a line of ads.txt, spot a bad relationship type, and know what to fix before you publish to https://example.com/ads.txt.

Free tool

Use the ads.txt Validator now

Open the interactive ads.txt validator in your browser — free, instant, no signup.

Open ads.txt Validator

What Is ads.txt and Why Do Publishers Use It?

ads.txt (“Authorized Digital Sellers”) is an IAB Tech Lab specification. A publisher hosts a text file at the root of their domain listing advertising systems authorized to sell their inventory. Programmatic buyers and verification vendors crawl that file when they evaluate bid requests.

  • Transparency — buyers can cross-check the seller in the bid stream against the publisher’s list
  • Fraud reduction — spoofed domains and unauthorized resale become easier to flag
  • Operational clarity — your ad ops team documents who may sell which inventory

The file is intentionally simple: one record per line, optional comments, no fancy encoding. That simplicity is also why small typos — a wrong field order, a misspelled relationship, a smart quote from a Word doc — break automated parsers.

Validate drafts with the free ads.txt validator before you deploy. Treat ads.txt like production config: review diffs, avoid drive-by edits in live files, and re-check after every partner onboarding.

What Does a Valid ads.txt Record Look Like?

A standard data record has three required fields and one optional field, separated by commas:

domain, publisher_account_id, relationship[, certification_authority_id]

  • domain — the advertising system’s canonical domain (not your site’s domain on every line)
  • publisher_account_id — the account ID that system assigned to you (formats vary by partner)
  • relationship — either DIRECT or RESELLER (case-sensitive in practice for many crawlers; use uppercase as specified)
  • certification_authority_id — optional TAG ID or similar authority identifier when provided

Example shape (illustrative only — use IDs your partners give you):

example-ssp.com, pub-123456, DIRECT, f08c47fec0942fa0
example-reseller.com, abcdef, RESELLER

Comments start with # and can sit on their own line or after a record, depending on how you maintain the file. Keep comments clear — future you will thank present you when a partner rotates IDs.

Field order is not optional. Swapping the account ID and relationship is a common copy-paste error. If you need to inspect messy text or extract patterns from partner emails, the regex tester and regex guide help you pull domains and IDs cleanly.

How Do DIRECT and RESELLER Relationships Differ?

The relationship field tells buyers how the listed system is authorized to sell your inventory.

  • DIRECT — you have a direct business account with that advertising system. They are not merely reselling through another intermediary in this declaration.
  • RESELLER — you authorize that system to resell your inventory. Often used for reseller networks and certain partner paths your direct SSP enables.

Using RESELLER when the partner expects DIRECT (or the reverse) confuses buyers and can suppress demand. Always copy the relationship type from the partner’s official ads.txt instructions, not from another publisher’s public file you found in a search result.

Some partners appear twice with different account IDs or both relationship types across business units. That can be valid when the partner documents it. Duplicate identical lines are noise — clean them up. Conflicting guidance from two account managers should be escalated before you publish both “just in case.”

When partners send JSON or CSV exports of suggested lines, pretty-print and inspect structure with the JSON formatter validator and the JSON validation guide so you do not paste broken fragments into ads.txt.

What Should You Check in Domains and Account IDs?

Most validation failures are boring field-level mistakes. Catch them line by line.

  • Domain spellingdoubleclick.net versus a typo subdomain; use the domain the partner specifies for ads.txt, which may differ from their marketing site
  • No protocol — write partner.com, not https://partner.com/path
  • Account ID accuracy — leading zeros, mixed case, and hyphens matter; do not “clean up” IDs
  • Extra spaces — trim fields; stray spaces inside IDs break matching
  • Wrong owner domain — ads.txt lives on the publisher inventory domain; records list seller systems, not random third parties

Placeholder text is a classic launch bug: lines that still say INSERT_PUBLISHER_ID or YOUR_ID_HERE after go-live. Search the file for “TODO,” “INSERT,” and “example” before you ship.

If you receive IDs in email bodies with hidden characters or line breaks, paste into the string length checker / string length guide workflow to spot unexpected characters, or validate contact addresses on partner forms with the email validator when onboarding paperwork is the messy part — not the ads.txt line itself.

What Common ads.txt Errors Should You Fix First?

Fix high-impact issues before you debate edge-case optional fields.

  • Missing file or wrong path — must be served at /ads.txt on the relevant domain (and often on www vs non-www consistently with how inventory is sold)
  • HTML error page instead of text — a soft 404 that returns your site template is not a valid ads.txt
  • Wrong content type / CMS injection — some CMS themes wrap plain files; ensure crawlers get text
  • Invalid relationship tokens — only DIRECT and RESELLER for standard records (not “Direct” with odd spacing, not “VAR”)
  • Comma problems — missing commas, semicolons instead of commas, or European decimal commas in IDs
  • Ownerdomain / managerdomain / inventorypartnerdomain — extension variables exist in the broader ads.txt ecosystem; use them only as the current spec and your partners require, with correct syntax

After editing, re-run the free ads.txt validator and fetch the live URL in a private window to confirm CDN or cache layers serve the new body. Propagation delays on multi-CDN setups can make one region see an old file.

Document who owns the file in your org. Orphan ads.txt files rot when the last ad ops hire leaves and a redesign overwrites root files.

How Do You Validate ads.txt Step by Step?

Use a repeatable workflow every time a partner sends “please add this line.”

  1. Collect the partner’s official ads.txt snippet (domain, account ID, relationship, optional authority ID).
  2. Paste your full draft into the free ads.txt validator.
  3. Fix every invalid line — field count, relationship token, domain shape — until the draft is clean.
  4. Diff against production so you do not drop unrelated partners by accident.
  5. Publish to the correct root path over HTTPS and confirm a plain-text response body.
  6. Recheck the live contents after cache TTL; keep a dated backup of the previous file.
  7. Notify partners only after the live file contains their line exactly as specified.

For pattern-heavy cleanups across large files, the regex testing guide helps you find duplicate domains or malformed rows quickly. Keep secrets out of comments — ads.txt is public.

Generatr’s validator runs privately in the browser so you can review drafts without uploading publisher contracts to a third-party server.

How Do You Maintain ads.txt Without Breaking Demand?

Validation is not a one-time launch task. Inventory partners change IDs, you sunset resellers, and domains migrate.

  • Quarterly audit — remove dead partners; confirm active partners still recognize their lines
  • Domain migrations — new brand domains need their own ads.txt; redirects alone are not always enough for crawlers
  • Subdomains and apps — inventory on subdomains may need separate files or clear ownership declarations per current guidance
  • Change control — PR review for ads.txt in static hosting repos prevents silent overwrites

When a buyer says you are “not authorized,” compare their expected line to your live file character by character. Often the account ID is from a different seat or the relationship type is wrong. Less often, they crawl a different host (www vs apex) than the one you updated.

Pair ads.txt hygiene with other publisher tech checks — structured data and config files benefit from the same careful formatting mindset you use with the JSON formatter guide.

Step-by-Step Instructions

  1. 1Collect each partner’s official domain, publisher account ID, relationship (DIRECT or RESELLER), and optional authority ID.
  2. 2Build or update a plain-text ads.txt draft with one record per line in the correct field order.
  3. 3Paste the draft into the free ads.txt validator and fix every formatting or relationship error.
  4. 4Search for placeholders, smart quotes, and duplicate conflicting lines before publish.
  5. 5Deploy the file to https://your-domain/ads.txt as raw text (not an HTML error page).
  6. 6Fetch the live URL and confirm the body matches your draft after caches refresh.
  7. 7Diff against the previous version so you do not remove active partners by mistake.
  8. 8Schedule periodic audits when partners change IDs or you sunset resellers.

Frequently Asked Questions

What is ads.txt?+

ads.txt is an IAB Tech Lab text file publishers host at /ads.txt to list advertising systems authorized to sell their digital inventory, improving transparency for programmatic buyers.

What is the difference between DIRECT and RESELLER?+

DIRECT means you have a direct account with that advertising system. RESELLER means you authorize that system to resell your inventory. Use the type your partner’s official instructions specify.

Where should ads.txt be hosted?+

On the inventory domain at the root path /ads.txt over HTTPS, returned as plain text. Confirm www versus apex matches how your inventory is actually sold and crawled.

What are common ads.txt formatting errors?+

Wrong field order, invalid relationship tokens, URLs instead of bare domains, placeholder account IDs, smart quotes, and HTML soft-404 pages instead of a real text file.

Can I put comments in ads.txt?+

Yes. Lines or trailing notes using # are commonly used for human context. Keep comments accurate and never put private contract terms you would not want public.

Is Generatr’s ads.txt validator free?+

Yes. It validates record structure, DIRECT/RESELLER values, and domains with client-side processing so drafts stay private — no account required.

Ready to try it yourself?

Use the free ads.txt Validator — no download, no account.

Launch ads.txt Validator