DEV Community

Andriy Pyvovarchuk
Andriy Pyvovarchuk

Posted on • Originally published at llms-txt-validator.dev

llms.txt vs robots.txt vs sitemap.xml: what actually does what

If you run a website in 2026 you now have three plain-text files that can live at your root and all look suspiciously similar: robots.txt, sitemap.xml, and the newcomer, llms.txt. They get confused constantly — I've seen people add llms.txt thinking it blocks AI crawlers (it doesn't) or skip it thinking robots.txt already covers it (it doesn't). Here's the clean mental model.

The one-line version

  • robots.txt → controls crawler access: which paths bots may or may not fetch.
  • sitemap.xml → lists every indexable page so search engines miss nothing.
  • llms.txt → curates a shortlist of high-signal pages for AI models at answer time.

Access, coverage, curation. Three different jobs.

robots.txt is about permission

robots.txt is an access-control convention: "Googlebot may crawl /blog but not /admin." It's a bouncer at the door. It doesn't describe your content, doesn't rank it, and isn't written for language models in particular. Blocking or allowing a path there says nothing about what the page is — only whether a bot may request it.

Crucially: llms.txt is not an access-control file. It can't stop an AI crawler from reading anything. If that's your goal, robots.txt (and server-side rules) is still the tool.

sitemap.xml is about coverage

A sitemap tries to be exhaustive: every URL you want indexed, so search engines don't overlook a page. It's machine-oriented XML for crawlers, not a human-readable summary, and it makes no attempt to say which pages matter most — they're all just listed.

llms.txt is about curation

llms.txt is the opposite of exhaustive. It's a hand-picked, Markdown list of the few pages that best help a model understand and use your site, each with a short description. It exists for inference — the moment a user asks ChatGPT or Claude "how do I do X with your product" — not for training datasets and not for access control.

# Acme

> Acme turns CSV files into charts. These links cover setup, the API, and pricing.

## Docs
- [Quickstart](https://example.com/quickstart): first chart in 5 minutes
- [API reference](https://example.com/api): endpoints and auth
Enter fullscreen mode Exit fullscreen mode

Where a sitemap says "here is everything," llms.txt says "here is what's worth your limited context window."

You don't choose — you use all three

This is the part people miss. A strong 2026 setup has all three, each doing its job:

File Question it answers Audience
robots.txt May you fetch this? all crawlers
sitemap.xml What should you index? search engines
llms.txt What matters most here? AI models

robots.txt governs access, sitemap.xml ensures coverage, and llms.txt curates signal for AI. They complement each other; none replaces another.

Getting llms.txt right

The catch with llms.txt is that it's easy to write one that looks valid but points at dead links or ships as the wrong content type — and unlike the other two, almost nobody checks it. After you write yours, run it through an llms.txt validator that fetches every linked URL and confirms it resolves, then fix whatever it flags. Aim for no broken links first; structure second.

Three files, three jobs. Once that clicks, llms.txt stops being mysterious — it's just the curation layer the web didn't have until AI needed one.

Top comments (1)

Collapse
 
citedy profile image
Dmitry Sergeev

finally someone explaining llms.txt. i was wondering if it actually overrides robots.txt or if they just work side by side