An ads.txt line contains exactly three required comma-separated fields — the advertising system domain, the seller or publisher account identifier, and a DIRECT or RESELLER relationship — with an optional fourth field for a certification authority ID supplied by the platform. Every authorized seller becomes one such line, the file is plain text, and it must be published at the root of the inventory-owning domain so that programmatic buyers can fetch /ads.txt without authentication. The format itself is defined by the IAB Tech Lab specification, and the goal is to give buyer crawlers a public list of accounts permitted to sell a publisher's inventory. A tool such as the Ads Txt Generator enforces the field-level rules so you do not have to memorize each token, and this cheat sheet compresses those rules, the validation gates, and the post-generation publish steps into one quick reference.

ads txt generator cheat sheet
ads.txt Generator Cheat Sheet: Field Rules and Output

The Four Fields in an ads.txt Line

Each row is a single authorized seller. Fields are comma-separated and the file ends with a trailing newline. The fourth column is the only field you may leave blank.

Position Field Format Notes
1 Advertising system domain Bare lowercase host, e.g. google.com Never include https://, a path, a port, a username, or a password.
2 Publisher account ID Platform-defined string, e.g. pub-0000000000000000 for Google Copy the exact value from the platform's setup instructions.
3 Relationship DIRECT or RESELLER Anything other than these two tokens is rejected.
4 Certification authority ID Optional string, e.g. f08c47fec0942fa0 Leave blank unless the platform supplies this exact value for the record.

Field Syntax Rules at a Glance

The generator normalizes what you paste rather than trusting it. Knowing the rules below lets you paste straight from each ad platform's instructions without second-guessing whitespace or capitalization.

  • Domain. Enter a bare host such as google.com. The generator lowercases the value, trims leading and trailing whitespace, and rejects anything containing a scheme, a slash, a colon-port segment, or userinfo. A trailing root dot is accepted and normalized; subdomain and punycode hosts are also accepted when entered in their bare form.
  • Publisher account ID. Paste the exact identifier the advertising platform shows you. For Google seller accounts, official guidance uses a pub- prefix followed by the account digits; other exchanges use different shapes, so do not invent or convert the value.
  • Relationship. Only the literal tokens DIRECT and RESELLER pass validation. Selecting the wrong relationship can make the declaration inaccurate even when every character is otherwise formatted correctly.
  • Certification authority ID. Optional. Google's published example includes f08c47fec0942fa0, but that string is not transferable to other exchanges. Leave the field empty unless the platform provides the exact value for the seller record you are adding.

DIRECT vs RESELLER at a Glance

The relationship field is the one most often mis-typed, and a wrong value does not produce a syntax error — it produces a misleading declaration. Use the table below to decide which token fits the seller you are adding.

Relationship Meaning Use when
DIRECT The site owner directly controls the account in the seller record and contracts directly with the advertising system. You hold the publisher account with the platform yourself and bill or get paid by that platform.
RESELLER Another authorized entity controls the listed account and is permitted to resell your inventory to its buyers. The account belongs to a partner, an exchange, or a third-party platform that is reselling your inventory.

If you are unsure which relationship applies, check the partner's onboarding paperwork or the platform's own ads.txt instructions before generating the file. The generator cannot verify the relationship; it can only confirm the token is one of the two allowed values. For a deeper look at authorizing Google sellers specifically, the guide to authorizing Google AdWords sellers in ads.txt walks through the same DIRECT vs RESELLER choice for Google's record.

Build the File with the Ads Txt Generator

Use the Ads Txt Generator when you already have each platform's domain, publisher ID, relationship, and optional certification authority ID in hand. The generator does not look up your accounts, so the input has to come from you.

  1. Open the Ads Txt Generator page so the entry form is visible.
  2. For the first seller, enter the bare advertising system domain (e.g. google.com) in the domain field. Do not paste a URL that includes https://.
  3. Enter the exact publisher account ID copied from the platform's setup instructions in the account ID field, including any pub- prefix when the platform uses one.
  4. Select DIRECT or RESELLER from the relationship field, matching the actual business relationship for that seller.
  5. If the platform supplies a certification authority ID for that record, paste it into the optional fourth field. Otherwise leave the field blank.
  6. Add the row to the visible list, then repeat the previous four steps for every additional authorized seller. The tool accepts up to 200 records so a single oversized paste will not produce an unwieldy browser result.
  7. Review the generated text row by row. Remove duplicates, obsolete entries, or any seller you no longer work with, and confirm that each domain, account ID, and relationship matches the platform's instructions.
  8. Copy the final text or use the download button to save a newline-terminated ads.txt file locally.

What the Generator Rejects

The page validates syntax, not authorization. It cannot sign into an ad account, confirm that a publisher ID belongs to you, or prove that a reseller is permitted to sell your inventory — those checks are yours. What it does do is refuse malformed input so the output stays standards-shaped. The boundary cases below are rejected on entry:

  • Schemes such as https://, paths such as /ads, port segments such as :8080, and userinfo such as user:pass@ in the domain field.
  • Commas or whitespace characters embedded inside any of the four fields.
  • Any relationship token that is not the literal DIRECT or RESELLER.
  • An exact duplicate row after the same seller has already been added.
  • Mixed-case domain values that get normalized to lowercase before comparison, so Google.com and google.com collide as the same seller.

The Google example used during testing is google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0. The string of zeros is a placeholder, not a usable publisher account, so swap it for your exact identifier before deploying. The tool deliberately does not prefill a real user ID or pick an advertising system for you, because the values have to match your actual agreements.

Publish and Verify the Public File

A syntactically valid file that is not served correctly does not protect your inventory. The deployment checklist below mirrors what buyer crawlers expect when they fetch your domain.

  • Save the downloaded text as ads.txt with no extension other than .txt and with a trailing newline at the end of the file.
  • Upload it to the root of the domain that owns the advertising inventory. For example.com, the expected public location is https://example.com/ads.txt.
  • Do not place the file under /files/ads.txt, inside an HTML page, behind authentication, or behind a redirect chain — only the root resource is treated as the canonical ads.txt file.
  • Keep a backup of the prior file so you can compare the change before and after each edit.
  • Open the public URL in a private browser tab and confirm the response is served as text/plain with the exact rows you generated.
  • Cross-check each line against the source instructions from the relevant advertising platform, then watch for partner reports after the next crawl cycle.

Account or network changes will require future updates, and a syntactically valid but unauthorized or incomplete file can still harm monetization. Reviewing the output against current instructions from each partner — and against the IAB Tech Lab ads.txt 1.1 specification — is the last step the generator cannot perform for you.

If you're weighing options, Should You Check AI Bot Robots.txt? A Decision Guide covers this in detail.