llms.txt & AI discovery files
Comparison

robots.txt vs llms.txt vs sitemap.xml: what each file does for AI

Short answer

robots.txt tells crawlers what they may access. sitemap.xml lists the pages you want found. llms.txt gives AI agents a short, curated guide to your most important content. robots.txt and sitemap.xml are established, widely supported files and matter most. llms.txt is an optional extra that few AI tools read today.

Cover: robots.txt vs llms.txt vs sitemap.xml. llms.txt & AI discovery files comparison.
On this page

    Key facts

    The comparison at a glance

    robots.txt sitemap.xml llms.txt
    Job Access rules: which bots may crawl which paths Discovery: a list of URLs you want crawled Guidance: a curated map of key content for AI agents
    Format Plain text, User-agent / Allow / Disallow lines XML Markdown
    Location Must be at the root: /robots.txt Usually /sitemap.xml, referenced from robots.txt /llms.txt, or a sub-path like /docs/llms.txt
    Status IETF standard (RFC 9309, 2022) Open protocol (sitemaps.org) Proposal (llmstxt.org, 2024)
    Who reads it Search engines and the main AI crawlers Search engines Some AI tools and agents, rarely so far
    Controls AI training? Yes, via tokens like GPTBot and Google-Extended No No
    Needed for AI visibility? Yes. Blocking AI search bots removes you from their answers Strongly recommended Optional

    robots.txt: the gatekeeper

    robots.txt is the oldest of the three and the only one that sets rules. It is now an internet standard, RFC 9309, published in September 2022.

    What it does for AI: the main AI companies document their bots' robots.txt names, so this file is where you decide who gets in. You can allow AI search bots such as OAI-SearchBot, Claude-SearchBot and PerplexityBot so you can be cited, and disallow training tokens such as GPTBot, ClaudeBot or Google-Extended. OpenAI's crawler documentation says these settings are independent of each other.

    What it can't do:

    • It isn't a lock. RFC 9309 says its rules "are not a form of access authorization".
    • It doesn't keep pages out of Google's index. Google's robots.txt introduction recommends noindex or password protection for that.
    • User-triggered fetchers, such as ChatGPT-User or Perplexity-User, may not follow it, according to OpenAI and Perplexity.

    Watch out for: each crawler follows only the single most specific group that matches it. Google's robots.txt specification says "Other groups are ignored", so a bot with its own group won't read your User-agent: * rules.

    sitemap.xml: the index

    A sitemap is an XML list of the URLs you want search engines to crawl, defined by the Sitemaps protocol.

    What it does for AI: it helps pages get discovered and indexed. That matters for AI search, because Google says a page must be indexed and eligible for a snippet in Google Search to appear as a supporting link in AI Overviews or AI Mode (AI features and your website).

    Useful facts:

    • One sitemap can hold up to 50,000 URLs and be up to 50 MB. Larger sites use a sitemap index.
    • You can point crawlers to it from robots.txt with a line like Sitemap: https://www.yourdomain.com/sitemap.xml.
    • Google says it ignores <priority> and <changefreq>, and uses <lastmod> only if it is consistently and verifiably accurate (Build and submit a sitemap). So keep lastmod honest and skip the rest.

    What it can't do: a sitemap doesn't guarantee indexing, and it says nothing about what the pages mean. It is a list, not a summary.

    llms.txt: the guide for AI agents

    llms.txt is a Markdown file proposed by Jeremy Howard in 2024 on llmstxt.org. It holds your site's name, a short summary and lists of links to your key pages, written so a language model can read it quickly.

    What it does for AI: when an agent does look at it, it gets a clean, small overview instead of having to parse your whole site. The proposal itself notes it is used most heavily for software documentation, where coding agents follow it to find API references.

    How it differs from a sitemap, according to the spec: a sitemap lists every indexable page, often far too much to fit in an AI model's context. llms.txt is curated, short, and can include links to external resources.

    What it can't do:

    • It has no access rules. It doesn't block or allow anything, and it doesn't opt you out of training.
    • It isn't required by Google. Google says you don't need AI text files or special markup to appear in AI Overviews or AI Mode.
    • It isn't widely read yet. An Ahrefs study of 137,210 domains found 97% of published llms.txt files received zero requests in May 2026.

    Which one matters most?

    If you're short on time, work in this order:

    1. robots.txt first. One wrong line can hide your site from AI search entirely. Check that search engines and AI search bots are allowed.
    2. sitemap.xml second. Make sure it exists, lists your important pages, has honest lastmod dates and is referenced in robots.txt.
    3. llms.txt third. Add it once the basics are in place. It's quick and low-risk, but don't expect it to move your AI visibility on its own.

    None of these files replaces good content. AI assistants cite pages that clearly answer the question being asked. The files only make sure those pages can be found and read.

    Check all three in one go

    The free Web2Agents scan checks your robots.txt and sitemap and tells you whether AI bots are blocked. To create a robots.txt and llms.txt from scratch, use the free .txt generator. The AI-Ready Kit gives you ready-to-upload robots.txt, llms.txt, llms-full.txt and schema files written for your site.

    {"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"Do I need all three files?","acceptedAnswer":{"@type":"Answer","text":"You need robots.txt and a sitemap. llms.txt is optional. It's cheap to add, but current data shows few AI tools fetch it."}},{"@type":"Question","name":"Can llms.txt replace my sitemap?","acceptedAnswer":{"@type":"Answer","text":"No. A sitemap lists all the pages you want indexed for search engines. llms.txt is a short, curated guide for AI agents. They do different jobs."}},{"@type":"Question","name":"Can I block AI training with llms.txt?","acceptedAnswer":{"@type":"Answer","text":"No. llms.txt has no access rules. To opt out of AI training, disallow training tokens such as GPTBot, ClaudeBot or Google-Extended in robots.txt."}},{"@type":"Question","name":"Where should each file live?","acceptedAnswer":{"@type":"Answer","text":"robots.txt must be at the root of each domain or subdomain. sitemap.xml is usually at the root and referenced from robots.txt. llms.txt is usually at the root, at /llms.txt."}},{"@type":"Question","name":"Does Google use llms.txt for AI Overviews?","acceptedAnswer":{"@type":"Answer","text":"Google says no AI text files or special markup are needed to appear in AI Overviews or AI Mode. Normal SEO requirements apply: the page must be indexed and eligible for a snippet."}}]}

    FAQ

    Do I need all three files?

    You need robots.txt and a sitemap. llms.txt is optional. It's cheap to add, but current data shows few AI tools fetch it.

    Can llms.txt replace my sitemap?

    No. A sitemap lists all the pages you want indexed for search engines. llms.txt is a short, curated guide for AI agents. They do different jobs.

    Can I block AI training with llms.txt?

    No. llms.txt has no access rules. To opt out of AI training, disallow training tokens such as GPTBot, ClaudeBot or Google-Extended in robots.txt.

    Where should each file live?

    robots.txt must be at the root of each domain or subdomain. sitemap.xml is usually at the root and referenced from robots.txt. llms.txt is usually at the root, at /llms.txt.

    Does Google use llms.txt for AI Overviews?

    Google says no AI text files or special markup are needed to appear in AI Overviews or AI Mode. Normal SEO requirements apply: the page must be indexed and eligible for a snippet.

    Sources

    Newsletter

    New guides on AI visibility, in your inbox.

    Practical, sourced articles on AI crawlers, llms.txt, structured data and AI search. A new one every day.

    Unsubscribe anytime. See our Privacy Policy.