How to Write an llms.txt File (With a Copy-Paste Template)
Write an llms.txt file in under half an hour: the exact format, a copy-paste template, page selection rules, and how to validate it once published.
GEO · 8 min read · Step-by-step
An llms.txt file is a small Markdown document at the root of your site that tells AI tools what your site is, which pages matter most, and which ones they can skip. It was proposed by Jeremy Howard of Answer.AI in September 2024 and is documented at llmstxt.org. Writing a good one takes under half an hour, and this guide gives you the exact format, a template you can copy, and the mistakes that make most files useless.
One honest caveat before you start: llms.txt is a proposed convention, not a standard, and none of the major AI vendors' crawler documentation currently says their crawlers read it. Treat it as low-cost documentation that helps the tools that do use it — and as a genuinely useful map of your own site — not as a guaranteed ranking lever. The cost is thirty minutes; the cost of doing it badly is a file that misleads the few readers it gets.
Step 1: Pick 10 to 30 pages, not 300
The file's job is selection, not inventory. Your sitemap already lists every URL; llms.txt answers a different question — if a smart new colleague had ten minutes before answering questions about your site, which pages would you hand them?
Start with the pages you would send someone who needs to understand your product: what it does, what it costs, how it works, and the two or three guides that answer your most common questions. A typical software site ends up with 10 to 30 links. If a page would not help someone answer a question about your product, leave it out. A file that lists everything is a sitemap in Markdown clothing, and nobody — human or model — will read it as a guide.
Step 2: Write the H1 and the blockquote summary
The format, in the order the spec defines it, is:
- An H1 with the name of the site or project. This is the only required element.
- A blockquote summary. One or two sentences with the key facts someone needs to understand everything below it.
- Optional plain paragraphs or bullet lists with extra context — no headings in this part.
- H2 sections, each containing a list of Markdown links with an optional note after each one.
- An optional
## Optionalsection. By convention, links here are secondary; an agent short on context can skip them.
Write the blockquote like an encyclopedia entry, not a tagline. It should state what the product is, who it is for, and one or two hard facts — price, trial, or a defining limit. Skip slogans; a model cannot answer "what does this cost?" from "the future of work, reimagined."
# Example Co
> Example Co makes invoicing software for freelancers. It covers quotes, recurring billing and tax exports for the US and UK. Plans start at $12 per month; there is a free plan for up to 3 clients.
- Founded in 2019, based in Lisbon. Support by email, replies within one business day.
- The product runs in the browser; no install is needed.
- Not a fit for companies that need multi-currency payroll.
Step 3: Group the links by what the reader is trying to do
Group sections by task, not by your site's navigation. "Product", "Docs", and "Guides" work; "Pages" and "Misc" do not. Every link is a Markdown link with an optional note after a colon — and the note is where the value lives. A bare URL tells a reader where a page is; a factual note tells them whether it answers their question.
## Product
- [Features](https://example.com/features): What the product does, grouped by use case.
- [Pricing](https://example.com/pricing): Plans, limits and what each plan includes.
## Docs
- [Getting started](https://example.com/docs/getting-started): Create an account and send your first invoice in under ten minutes.
- [API reference](https://example.com/docs/api): Endpoints, authentication and rate limits.
## Guides
- [How to charge a late fee](https://example.com/blog/late-fee): Step-by-step guide with an example invoice.
Rules that matter: use absolute URLs, point them at clean public pages that load directly (no login, no redirect chain), and write a factual note for every link. If you cannot write a factual note for a page, the page probably should not be in the file.
Step 4: Add the Optional section
The ## Optional section holds the links a reader can skip when context is tight: changelog, careers, press, older blog posts. Putting them here instead of deleting them keeps the file complete without diluting the sections above it. If your file has no secondary pages, leave the section out — an empty Optional section is worse than none.
Step 5: Publish at the root and validate
Save the file as llms.txt — not llms.md, not llms.txt.md — and upload it to your site's root directory so it resolves at https://yourdomain.com/llms.txt. The file must live at the root; /docs/llms.txt is not the root, and crawlers look for /llms.txt.
Validate it in one minute:
curl -I https://yourdomain.com/llms.txt
You want a 200 status, served as plain text or Markdown, with no redirect to a login page and no JavaScript required to render it. Then open the URL in a browser and read it as a stranger would: does the summary state what the site is, do the sections answer the obvious questions, and does every link resolve? The spec also suggests serving a clean Markdown version of important pages at the same URL with .md appended — for example /docs/start.md — and linking those from the file. That is optional, but it is the difference between pointing at your docs and handing over a readable copy.
Step 6: Generate it instead of hand-writing it
Hand-writing is fine for a first version, but files drift: prices change, pages move, and the file silently goes stale. If your site already has a fix workflow, generate the file from the live pages instead. AEOTools' fix module generates an llms.txt from your site's actual pages — title, summary, and section links drawn from what is live now, not what you remembered in September — and validates it the same way a crawler would. Whether you generate or hand-write, re-check the file whenever pricing, positioning, or your core pages change; a stale llms.txt misleads more than no llms.txt at all.
Common mistakes
| Mistake | Why it hurts |
|---|---|
File in the wrong place (/docs/llms.txt) |
Crawlers look for /llms.txt at the root and will not find it |
| Listing every URL | Selection is the file's job; a full list is a sitemap |
| Slogan summary | No facts for a reader to answer questions with |
| Bare links with no notes | The reader cannot tell which page answers their question |
| Relative URLs | Meaningless outside your site's own context |
| Never updating it | Stale prices and dead links actively misinform |
FAQ
Do ChatGPT and Claude actually read llms.txt?
No major AI vendor's crawler documentation currently confirms that its crawlers read llms.txt. The file is a proposed convention from 2024, and adoption is uneven. Write one because it costs little, helps the tools that do use it, and forces you to state your site's facts clearly — not because any vendor guarantees to read it.
Is llms.txt a replacement for sitemap.xml?
No. The spec is explicit: llms.txt is not meant to replace sitemap.xml. A sitemap lists every URL for crawlers; llms.txt selects the most important pages and explains them. Keep both, and keep them consistent — a page in llms.txt that is missing from the sitemap, or vice versa, is a signal something is off.
Should llms.txt list every page on my site?
No. Pick 10 to 30 pages: what the product does, what it costs, how it works, and the guides that answer your most common questions. If a page would not help someone answer a question about your product, leave it out — or put it in the ## Optional section if it still deserves a mention.
What is llms-full.txt?
llms-full.txt is the companion convention: a single file containing the full text of the pages listed in llms.txt, for cases where a reader wants the complete content in one fetch. It is optional. Start with llms.txt; add llms-full.txt only if your key pages are short enough that one combined file stays readable.