Writing an llms.txt file
An llms.txt file needs only a title to be valid, but a useful one takes a little more: a one-paragraph summary, a few notes an agent needs to read your site correctly, and short lists of your most useful pages, each with a line on what it answers. This guide walks through writing one, gives two complete example files, and lists the mistakes we found most often in our July 2026 study, marking which are breaches of the proposal and which are LLMSRank’s own recommendations.
Before you start
Decide what the file covers. A file at /llms.txt covers the whole site; a file at a path such as /docs/llms.txt covers the pages under that path, and agents should use the most specific file that applies. Most sites need one file at the root. A site with a large documentation section may want a second one at /docs/llms.txt. The format and placement rules are on the explainer page.
Then list the questions people and agents actually ask about you, and the pages that answer them. That list, not your navigation menu, is the raw material for the file.
Step by step
- Write the H1. The first heading is
#followed by the name of your site or project. It is the only element the proposal requires. - Add a summary blockquote. One or two sentences starting with
>: what you are, who you serve, and anything needed to understand the rest of the file. - Add notes, if you need them. Paragraphs or lists (no headings) that tell an agent how to read your content: what you don’t do, which prices are estimates, which version of an API is current.
- Group your links under H2 headings. Name sections for what a reader wants (
## Services,## API reference,## Policies). Each entry is a list item:- [Page name](https://…): what this page answers. - Point links at readable content. The proposal says links “should therefore point to LLM-friendly content, such as the markdown versions of pages”. If you have markdown versions of your pages, link those.
- Put secondary links last, under `## Optional`, if you want. By convention these are links an agent can skip. Since v2 the heading has no special meaning to tools.
- Publish it at the path you chose, so that it returns the file itself with a 200 status.
- Test it. Ask an agent questions about your site with only the file as a starting point, check the draft in the llms.txt editor, then scan it for a graded report.
Example: a small business
A local service company with no API. It uses every element of the format. The Last updated line is LLMSRank’s recommendation, not part of the proposal; the proposal allows it as body text.
# Northside Plumbing
> Family-run plumbing company serving Springfield and the surrounding towns since 1998. Licensed and insured. Emergency call-outs 24 hours a day, 7 days a week.
We work on homes and small businesses only, not new construction. Prices on our site are starting prices; every job is quoted before work begins.
Last updated: 2026-09-01
## Services
- [Emergency repairs](https://example.com/emergency): What counts as an emergency, call-out fees, and how fast we arrive.
- [Water heaters](https://example.com/water-heaters): Repair and replacement, the brands we install, and typical costs.
- [Drain cleaning](https://example.com/drains): Blocked drains and sewer lines, and when a camera inspection is needed.
## Booking and policies
- [Book a visit](https://example.com/book): Online booking, opening hours, and the towns we cover.
- [Pricing and payment](https://example.com/pricing): Starting prices, how quotes work, and accepted payment methods.
- [Guarantee](https://example.com/guarantee): Our 12-month guarantee on parts and labour, and what it excludes.
## Optional
- [About us](https://example.com/about): The family, the team, and our licence numbers.The notes paragraph does work a list of links can’t: it tells an agent not to quote a starting price as a final price, and not to suggest the company for new construction. The links go to ordinary HTML pages because this site has no markdown versions yet. That is allowed; adding markdown versions and linking them instead is the next improvement.
Example: a documentation site
An API’s documentation, published at https://example.com/docs/llms.txt so it covers everything under /docs/. Every link goes to a markdown version, and the machine-readable spec is linked directly.
# Acme API
> Acme is a REST API for sending transactional email. This file covers the documentation at example.com/docs/. Every page linked below has a markdown version.
Important notes:
- All requests need an API key in the Authorization header; keys are created in the dashboard.
- The v1 API is deprecated. Use v2 endpoints unless a page says otherwise.
## Getting started
- [Quickstart](https://example.com/docs/quickstart.md): Send a first email in five minutes with curl, Node or Python.
- [Authentication](https://example.com/docs/auth.md): Creating, scoping and rotating API keys.
## API reference
- [Send an email](https://example.com/docs/api/send.md): POST /v2/emails, every parameter and response field.
- [Webhooks](https://example.com/docs/api/webhooks.md): Delivery, bounce and complaint events, and how to verify signatures.
- [Errors and rate limits](https://example.com/docs/api/errors.md): Error codes, retry advice and per-plan limits.
- [OpenAPI spec](https://example.com/docs/openapi.json): The machine-readable definition of the v2 API.
## Optional
- [Changelog](https://example.com/docs/changelog.md): Releases since 2024.
- [v1 reference](https://example.com/docs/v1/index.md): The deprecated v1 API, for existing integrations.The proposal’s own full example is a cut-down version of the FastHTML project’s file, at llmstxt.org. Its notes section follows the same idea: say plainly what the library is not compatible with, so an agent doesn’t guess.
The proposal’s guidelines
The llms.txt text gives four guidelines “to create effective llms.txt files”, verbatim:
- “Use concise, clear language.”
- “When linking to resources, include brief, informative descriptions.”
- “Avoid ambiguous terms or unexplained jargon.”
- “Test your file by asking an agent questions about your content, giving it only your llms.txt as a starting point.”
The last one is new in v2. It replaces v1’s advice to run a tool that expanded the file into one large context, which v2 dropped from the proposal.
In practice, an informative description says what the page *answers*, not what it *is*: “Call-out fees, and how fast we arrive” beats “Emergency page”.
Linking to markdown versions
The proposal asks pages that agents might need to offer a clean markdown version at the same URL, either with .md appended (page.html.md) or with the extension replaced (page.md); URLs without a file name use index.html.md or index.md. Link those URLs from your llms.txt where they exist.
Pages can also advertise their markdown version and the llms.txt that covers them with rel="alternate" and rel="describedby" links. Both are covered in Markdown page versions and link relations.
Common mistakes we see
From LLMSRank’s research corpus: 723 domains checked in July 2026 and re-checked in October, 187 llms.txt files archived and parsed. Only the first row breaks the proposal. The rest are problems under LLMSRank’s rubric, which goes further than the proposal does; each links to the audit that scores it.
| Mistake | What we found | Proposal or our rubric? | Fix |
|---|---|---|---|
| No H1 | 5 of 187 files have no H1. | The proposal: the H1 is “the only required section”. Our rubric: Single H1. | Make the first line # Your Site Name. |
| An HTML page at /llms.txt | 52 domains return an HTML page at /llms.txt instead of a markdown file. | The proposal describes a markdown file but doesn’t name a Content-Type. Our rubric: Content type wants text/plain or text/markdown. | Serve the markdown file itself, and a real 404 until it is ready. |
| Blocked in robots.txt | 3 sites publish an llms.txt while their robots.txt blocks AI crawlers from fetching it. | The proposal doesn’t say. Our rubric: AI crawler access, and a score cap of 25. | Allow the AI crawlers you want (for example GPTBot, ClaudeBot, PerplexityBot) to fetch /llms.txt. |
| No date or version | Only 20 of 187 files carry a version or last-updated stamp. | The proposal doesn’t say. Our rubric: Freshness signals, for sites whose content changes. | Add one line such as Last updated: 2026-09-01, and change it when the file changes. |
| No AI crawler named in robots.txt | Only 111 of the 556 robots.txt files we could read name any AI crawler at all. | The proposal doesn’t say. Our rubric: Named AI crawlers. | Add explicit User-agent groups for the AI crawlers you want. |
| Only on a subdomain | At least 25 of 84 AI-company files live only on a docs or developer subdomain. | The proposal doesn’t mention subdomains; a file covers paths under it on its own host. Our scan checks the domain you enter. | Publish a file at yoursite.com/llms.txt too; it can link to the docs file. |
Frequently asked questions
How long should an llms.txt file be?
Should my links point to HTML pages or markdown?
Can llms.txt link to other websites?
Do I need an ## Optional section?
Should I put a date in llms.txt?
Last updated line for sites whose content changes, so agents can judge freshness; only 20 of 187 files in our study had one.What Content-Type should I serve llms.txt with?
text/plain or text/markdown, and scores an HTML page at /llms.txt as a problem.