How to write an llms.txt file (with a copy-paste template)
If you want AI assistants and large language models to understand your site accurately, you can give them a short, curated map. That map is an llms.txt file. This guide explains what it is, where it goes, how to format it, and how to test it before you rely on it.
What llms.txt is
llms.txt is a proposed standard, introduced by Jeremy Howard in 2024 and documented at llmstxt.org. It gives language models a plain Markdown file that summarises your website: what it is, what it offers, and which pages matter most.
It works alongside two files you probably already have. robots.txt tells crawlers what they may access. A sitemap.xml lists every URL. llms.txt does something different: it selects the most important content and explains it in a format a model can read within a limited context window.
Be realistic about adoption. The standard is still informal, and not every AI company has confirmed that it reads llms.txt. Treat it as low-cost documentation that helps the tools that do use it, not as a guaranteed ranking lever.
Where it goes
The file must live at the root of your domain:
https://example.com/llms.txt
Serve it with a 200 status as plain text or Markdown. It should not redirect to a login page or depend on JavaScript to render. If you have subdomains such as docs.example.com and want them covered, publish a separate llms.txt on each one.
The format
The structure is deliberately simple. Include these parts, in this order:
- An H1 title. The name of the project or site. This is the only required element.
- A blockquote summary. One or two sentences that explain what the site is.
- Optional paragraphs. Extra context in plain prose, such as who the site is for or what is out of scope.
-
H2 sections. Groups of links, each written as a Markdown list item:
- [Link title](URL): short note. - An Optional section. Links a model can skip when context is tight.
Use absolute URLs and point them at clean, public pages that load directly.
Full copy-paste template
Replace the placeholders and delete any section you do not need:
# Example Co
> Example Co makes invoicing software for freelancers. The product covers quotes, recurring billing and tax exports for the US and UK.
Pricing changes from time to time, so check the pricing page for current numbers. Documentation covers the public REST API and the Zapier integration.
## Docs
- [Getting started](https://example.com/docs/getting-started): Create an account and send your first invoice
- [API reference](https://example.com/docs/api): Endpoints, authentication and rate limits
- [Webhooks](https://example.com/docs/webhooks): Event types and payload examples
## Product
- [Features](https://example.com/features): Full list of invoicing and tax features
- [Pricing](https://example.com/pricing): Plans and per-seat costs
## Optional
- [Blog](https://example.com/blog): Product updates and tutorials
- [Careers](https://example.com/careers): Open roles
Common mistakes
-
Putting the file in the wrong place.
/docs/llms.txtis not the root. Crawlers look for/llms.txt. - Dead or redirected links. Every URL should return 200. A list full of 404s signals an unmaintained file.
- Listing everything. Pasting 300 URLs defeats the purpose. Pick the 10 to 30 pages that answer the most common questions.
- Vague descriptions. "Our amazing solutions" tells a model nothing. Say what the page actually contains.
- Marketing copy in the summary. Keep the blockquote factual. Plain statements are easier to use than slogans.
- Forgetting the H1. Without a title the file does not follow the format, and parsers may fail on it.
-
Blocking the file. If a firewall, CDN rule or robots.txt rule blocks
/llms.txt, nothing else you write matters. - Letting it go stale. Update the file when you launch, rename or remove a major page.
How to test it
-
Check the status and redirects. Run
curl -I https://example.com/llms.txtand confirm a 200 response with no redirect chain. -
Check the content type. It should be
text/plainortext/markdown, nottext/html. - Read it as a stranger would. Open the file and ask whether someone who has never seen the site can tell what it offers from the first 20 lines.
- Check every link. Extract the URLs from the file and request each one with curl. Flag anything that is not a 200.
- Confirm the structure. The first line should be a single H1, followed by a blockquote, then H2 sections that contain list items.
- Check robots.txt. Make sure the pages you link are not disallowed for the AI user agents you want to reach.
Repeat these checks after every deploy that touches the file.
Summary
A good llms.txt is short, accurate and maintained. Start with ten strong links, a factual summary and a clean root URL, then expand as your documentation grows.
You can check your site's AI-crawler setup for free at https://citescore.vercel.app/free-check
Top comments (0)