How to Write an llms.txt File: Format Guide & Examples (2026)
AI models don't read your site the way a search engine crawler does. A crawler is happy to follow every link and index every page; a language model answering a live question has a limited context window and no patience for navigation menus, cookie banners, or twelve nested category pages. llms.txt exists to close that gap — a small, plain-text file that tells an AI model exactly what your site is, and exactly which pages matter.
This guide covers the exact format, a full working example, and the mistakes that make models ignore the file entirely. If you'd rather skip the manual work, our llms.txt generator builds a spec-compliant file from your sitemap in about a minute — but understanding the format helps you get more out of it either way.
What llms.txt actually is
llms.txt is a markdown file served at the root of your domain —https://yoursite.com/llms.txt — containing a structured, human- and machine-readable summary of your site: what it does, and a curated list of the pages worth reading, grouped by importance.
It was proposed by Jeremy Howard (Answer.AI) in September 2024 as a response to a real problem: LLMs increasingly need to retrieve information from the live web at inference time (via browsing tools, RAG pipelines, and agent frameworks), and most websites are optimized for human eyes and search engine crawlers, not for a model with a token budget. llms.txt gives you a way to hand the model a shortlist instead of hoping it picks the right pages out of your full nav.
It sits alongside two files you already know:
- robots.txt controls permission — which crawlers can access which paths.
- sitemap.xml is exhaustive — every indexable URL, for search engine discovery.
- llms.txt is curated — a hand-picked, prioritized summary for models, not a full URL dump.
We cover the differences in more depth in llms.txt vs robots.txt vs sitemap.xml if you want the full comparison.
The required structure
The spec is deliberately minimal. A valid llms.txt file has, in order:
- [name](url): optional one-line description.That's the whole spec. No JSON, no XML, no required metadata fields — just markdown a model (or a human) can read top to bottom in seconds.
A full working example
# Asva AI
> Asva AI is an Answer Engine Optimization (AEO) platform that tracks how brands
> appear inside ChatGPT, Perplexity, Gemini, Copilot, Grok, and Google AI Mode.
Asva AI helps marketing and SEO teams see whether their brand gets cited or
recommended in AI-generated answers, monitor competitors, and fix the content
gaps that keep them invisible to AI search.
## Docs
- [Getting started](https://asvaai.com/docs/getting-started): Connect your brand and run your first visibility scan
- [AEO glossary](https://asvaai.com/glossary/aeo-terms): Definitions for AEO, AI citations, and related terms
## Product
- [Brand visibility tracker](https://asvaai.com/features/brand-visibility-tracker): Monitor brand mentions across AI platforms
- [AI visibility report](https://asvaai.com/tools/ai-visibility-report): A shareable audit of your current AI search presence
- [llms.txt generator](https://asvaai.com/tools/llm-txt-generator): Generate a spec-compliant llms.txt from your sitemap
## Optional
- [Blog](https://asvaai.com/blogs): Guides on AEO, AI search, and llms.txt
- [Pricing](https://asvaai.com/pricing): Plans and pricing
Notice what's not in the required sections: pricing, blog posts, and anything a model can safely skip if it's tight on context. That's what the Optional section is for — it isn't a dumping ground, it's a deliberate signal of priority.
Five mistakes that make models ignore your file
1. Burying it in a subfolder. It has to be at the domain root./docs/llms.txt or /en/llms.txt won't be found by anything that checks the standard location first.
2. Skipping the blockquote summary. The H1 alone doesn't give a model enough to work with. The blockquote is the single line most likely to actually get read if a model only samples the top of the file.
3. Listing every URL on the site. llms.txt is not a second sitemap. If every one of your 400 pages is in the file with no prioritization, you've defeated the entire purpose — use the Optional section, or leave pages out entirely.
4. Writing descriptions that just repeat the title.- [Pricing](url): Pricing page tells a model nothing it didn't already know from the link text. Use the description to add context the title can't carry — what's actually on the page, or why it matters.
5. Letting it go stale. If you ship a new product page or rename a URL, llms.txt needs to be updated in the same release. A file pointing at 404s is worse than no file at all.
Validate before you ship
Once you've written or generated your file, run it through a validator before publishing — checking the H1, blockquote, section structure, and link syntax by eye is easy to get subtly wrong. Our llms.txt validator checks all of this automatically; see the full walkthrough in our llms.txt validator guide.
If you'd rather not write the file by hand at all, the llms.txt generator reads your existing sitemap and produces a properly structured, prioritized file you can review and publish in minutes.
See How Your Brand Shows Up in AI Search
Get a free AI visibility audit — see where you rank in ChatGPT, Perplexity, Gemini, and more.
Comments (0)
Leave a Comment
No comments yet. Be the first to comment!