Ads.txt Generator
Runs in your browser — your data is never uploaded.
Build the ads.txt line that tells advertisers who is allowed to sell your inventory. The format is four comma-separated fields and almost impossible to get wrong — except for the one field everybody does: AdSense shows your publisher ID as ca-pub-…, and ads.txt wants pub-…. A file with the wrong prefix parses perfectly and authorises nobody, which shows up as unsold inventory rather than an error.
How to use Ads.txt Generator
- 1
Choose your ad network and enter your publisher ID.
- 2
Pick DIRECT if you own the account, RESELLER if a partner sells on your behalf.
- 3
Click “Generate” and upload the file to the root of your domain.
Share
Embed this tool on your site
Paste this where you want the tool to appear. It runs entirely in your visitor's browser — no uploads, no account, no tracking.
Please keep the attribution line — it's what keeps these tools free.
Need a different size, a dark theme, or a different tool? Build an embed lets you preview it first.
Frequently asked questions
Where does ads.txt go?+
The root of your root domain: https://example.com/ads.txt. Not a subdirectory, and not a subdomain — crawlers check the root domain of the site serving the ads. It must return HTTP 200 as plain text; a redirect to it is fine, a 404 is read as “this site has no authorised sellers”, which is worse than having no file at all.
Why is my publisher ID rejected?+
Because of the ca- prefix. Google’s AdSense interface displays the ID as ca-pub- followed by 16 digits, and the ads.txt spec wants the pub- form without it. This generator strips it and tells you it did. It is by a distance the most common ads.txt error.
DIRECT or RESELLER?+
DIRECT if the account named in the line is yours and you control it. RESELLER if you have authorised someone else — a network or a monetisation partner — to sell your inventory on your behalf. Getting it wrong does not break the file, but it misstates the relationship that buyers use to judge legitimacy.
Do I need one line per network?+
Yes. Every exchange you work with needs its own line, in any order. A missing line means that network’s bids on your inventory get filtered out — the file is an allow-list, so silence is a refusal.
What about apps?+
Mobile app inventory uses app-ads.txt instead, served from the developer website listed in the app store entry. Same format, different filename and a different place to put it.