Site root files · Search & AI discovery · Updated 2026

llms.txt vs robots.txt vs sitemap.xml: What's the Difference?

Three tiny files, three very different jobs. robots.txt controls which crawlers may access your site, sitemap.xml tells search engines which URLs exist, and llms.txt tells AI engines what's worth reading.

Open the root directory of almost any serious website and you will find a small set of plain files: robots.txt, sitemap.xml, and — increasingly — llms.txt. They look similar — tiny, text-based files in the same folder, served to automated visitors — so it's tempting to assume they do the same job. They don't: each is read by a different consumer and answers a different question.

Below we compare all three and show how they work together.

What Is robots.txt? — Crawler Permission Control

robots.txt is the oldest of the three, dating back to the Robots Exclusion Protocol of 1994. It is a plain-text file placed at the root of a domain (https://example.com/robots.txt) that tells compliant crawlers which parts of the site they may or may not crawl.

Who reads it: search-engine crawlers — Googlebot, Bingbot, YandexBot, DuckDuckBot — and increasingly AI crawlers such as GPTBot, ClaudeBot, and PerplexityBot. Any compliant crawler checks robots.txt before it fetches anything else on your domain.

What it does: robots.txt does not rank, index, or describe anything — it is a permission system. Rules like Disallow: /admin/ stop compliant crawlers from requesting those paths, keeping private sections out of the crawl. It can also point crawlers at your sitemap via a Sitemap: directive.

User-agent: *
Disallow: /admin/
Disallow: /private/

User-agent: GPTBot
Disallow: /

Sitemap: https://example.com/sitemap.xml

One crucial caveat: robots.txt only governs well-behaved crawlers, and blocking a URL does not remove it from Google — it can even leave a bare URL-only result with no snippet. For true removal, use a noindex meta tag or HTTP header instead.

What Is sitemap.xml? — The Complete URL Inventory

sitemap.xml is an XML file that follows the Sitemap Protocol from sitemaps.org. It is an inventory of your site: a machine-readable list of every URL you want search engines to know about, optionally annotated with <lastmod>, <changefreq>, and <priority> hints.

Who reads it: search-engine indexers. Google, Bing, and others check the sitemap (typically referenced from robots.txt or submitted via Search Console) and use it to discover and prioritize new or rarely linked URLs.

What it does: a sitemap has no effect on rankings — it improves discovery. Pages that would otherwise wait weeks to be found through internal links get crawled quickly, and a fresh <lastmod> helps crawlers notice updates. Large sites split sitemaps into multiple files via a sitemap index.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-08-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/docs/getting-started</loc>
    <lastmod>2026-08-10</lastmod>
  </url>
</urlset>

Keep in mind a sitemap is a machine inventory, not a recommendation: it lists every URL with no notion of what is most important for a human or an AI to read first.

What Is llms.txt? — A Content Index Built for AI Engines

llms.txt is the newest of the three. Proposed by AI researcher Jeremy Howard in 2024 and specified at llmstxt.org, it is a small Markdown file at the root (https://example.com/llms.txt) that gives AI engines a curated, human- and LLM-readable index of your content. The file opens with an H1 title and an optional blockquote summary, followed by sections of Markdown links, each with a short description. It is designed to fit in a model's context window, so an agent can understand your whole site from one small file.

Who reads it: AI engines and agents — ChatGPT, Claude, Gemini, Perplexity, coding assistants, and retrieval tools. Adoption is accelerating: Chrome Lighthouse audits for it, platforms like Mintlify and GitBook generate it automatically, and OpenAI, Anthropic, and Google publish llms.txt files for their own docs.

What it does: where robots.txt says what not to crawl and sitemap.xml lists every URL, llms.txt tells an AI engine what the site is about and which pages to read first. It is curation, not inventory: you order links by importance, add descriptions, and point agents at clean Markdown versions of your pages. There is no ranking or crawling behavior attached — it is simply a content index.

# Example Docs

> Example is a developer platform for building serverless applications in Python and TypeScript.

## Important links

- [Quick start](https://example.com/docs/quickstart.md): Set up your first app in 10 minutes
- [API reference](https://example.com/docs/api.md): Complete REST API reference

## Optional

- [Changelog](https://example.com/changelog.md): Release notes for all past versions

llms.txt vs robots.txt vs sitemap.xml: Side-by-Side Comparison

Here is the full comparison. The short version: robots.txt manages crawler access, sitemap.xml feeds indexing, and llms.txt serves AI engines — three different consumers, three different jobs.

Dimensionrobots.txtsitemap.xmlllms.txt
Intended readerSearch-engine and AI crawlers (Googlebot, Bingbot, GPTBot)Search-engine indexers and crawlersAI engines and agents (ChatGPT, Claude, Gemini, Perplexity)
File formatPlain text (Robots Exclusion Protocol)XML (Sitemap Protocol)Markdown (llmstxt.org spec)
LocationRoot only: /robots.txtAny URL; typically referenced from robots.txtRoot by convention: /llms.txt (subpaths allowed)
Primary purposeControl which crawlers may access which pathsList every URL you want discovered and indexedCurate an index of what AI engines should read
Impact on Google rankingsNoneNoneNone — built for AI engines, not ranking
How it is discoveredChecked automatically by compliant crawlersVia Sitemap: directive or Search Console submissionFetched by convention at /llms.txt or found via links
Typical sizeA few lines to a few kilobytesUp to 50,000 URLs per file (usually split)Small enough to fit a context window
Typical exampleDisallow: /admin/<urlset> with <loc> entries# Site name + sections of Markdown links
If it is wrong or missingCrawlers may access things you wanted privateNew pages are discovered slowlyAgents misread your site or miss your best content

Can You Use robots.txt, sitemap.xml, and llms.txt Together?

Absolutely. None of these files substitutes for another — they work best as a pipeline answering three different questions:

robots.txt
Read by crawlers (Googlebot, GPTBot)
Answers: “May I crawl this?”
sitemap.xml
Read by search-engine indexers
Answers: “Which URLs exist?”
llms.txt
Read by AI engines (ChatGPT, Claude, Perplexity)
Answers: “What should AI read?”

Crawler flow: robots.txt → sitemap.xml → pages. AI flow: llms.txt → linked Markdown pages. robots.txt points crawlers at the sitemap via a Sitemap: directive; llms.txt is served directly to AI engines.

A practical setup for a modern site:

Common Misconceptions About These Three Files

FAQ: llms.txt vs robots.txt vs sitemap.xml

What's the difference between robots.txt and sitemap.xml?

robots.txt is a permission file for crawlers (“may I crawl, and where?”); sitemap.xml is a URL inventory for indexing (“these URLs exist”). They interact via the Sitemap: directive in robots.txt, but permission control and discovery are two different jobs.

Does llms.txt replace my sitemap.xml?

No. sitemap.xml feeds search-engine indexing with every URL you own; llms.txt feeds AI engines with the curated subset that matters most — different consumers, formats, and goals. Most sites should publish both, plus robots.txt.

Where should llms.txt live, and how do AI engines find it?

At the site root by convention — https://your-domain.com/llms.txt, next to robots.txt. Agents that support the convention check that URL automatically; linking from your homepage or footer helps discovery. Subpaths (e.g. /docs/llms.txt) work too, covering just that section.

Ready to add llms.txt to your site?

Generate a spec-compliant llms.txt in under a minute, then validate it for AI-readiness — no sign-up needed.

⚡ Generate your llms.txt Check my file