The 30-second answer: how to write llms.txt
A finished llms.txt has five blocks in a fixed order: a title line, a summary in a blockquote, an optional paragraph of notes for the AI, one or more sections of links with descriptions, and an Optional section for links that can be skipped. The skeleton looks like this:
# Your site or business name > One or two sentences: what you are, who you serve, where, since when. A few plain-text facts an AI tends to get wrong about you. ## Section name - [Page name](https://yoursite.com/page): What this page tells a visitor. ## Optional - [Less important page](https://yoursite.com/other): Why it exists.
Under the current spec (v2, revised August 2026) only the title line is strictly required. In practice you want all five blocks, because the summary and the descriptions are what an assistant reads to decide whether and how to cite you. The 30 minutes below are spent almost entirely on those two things.
Before you start (5 minutes)
- A list of your pages. Open your site’s navigation or
sitemap.xmland copy the URLs of every page you would be happy for an AI to send a customer to. You will cut this list down; start wide. - The three questions customers actually ask. Price, location, how to book, whether you do X. Write them at the top of your draft. Every link you keep should help answer one of them.
- A plain-text editor. Notepad, TextEdit in plain-text mode, VS Code, or any code editor. Not Word. The file must be saved as UTF-8 text named
llms.txt.
Minutes 0–5: the title and the summary
The H1
One line, starting with #, containing the name you want quoted. Not a slogan, not a page title from your CMS. If the name alone is ambiguous, add the kind of thing it is: # Northgate Bookkeeping rather than # Northgate. This is the only line the spec makes mandatory: the validator fails a file that has none and warns about one that has two.
The blockquote
One or two sentences after a >. This is the sentence an assistant is most likely to reuse when it mentions you by name, so it should read like an answer to “what is this?”: what you do, for whom, where, and since when if tenure matters. Facts, in plain words, no adjectives that could apply to any business.
A quick test: paste just this line into any AI assistant and ask “what does this company do?”. If the answer is vague, the summary is vague.
Minutes 5–10: notes for the AI
Between the summary and the first section, the spec allows any plain Markdown that is not a heading: a paragraph, a short list. Most small sites skip it; the best files use it for the two to four facts an assistant is most likely to get wrong. Good candidates:
- What you do not do (“we do not ship outside the UK”).
- What changed recently (“the Lite plan was discontinued in 2025”).
- What requires an account or a login, so it is not cited as public.
- Which language the file and the site are in, if you have more than one.
Keep it under five lines. This is not a place for a mission statement, and it is not a prompt: it is a correction list, in the same neutral tone as the rest of the file.
Minutes 10–20: sections and links
Name sections for what the reader wants
Each ## heading starts a list of links. Two to four sections is plenty for a small site. Name them for the intent a visitor arrives with, not for your site’s menu structure: Services, Pricing, Visit us, Guides. Avoid catch-all names like “Resources” or “More”; an assistant scanning headings learns nothing from them.
Choose links by the customer’s question, not by page count
Go back to your wide list and keep a page only if you can name the question it answers. A services page, a pricing page, an about page with the location and credentials, a booking or contact page, and two or three of your most useful guides is a normal result. Most finished files have 5–25 links; a first draft with 8–12 is fine. If you are tempted to list everything, remember that sitemap.xml already does that.
Write the URLs carefully
- Full
https://URLs, never relative paths. The validator flags links without a scheme. - The canonical form: no tracking parameters, no session IDs, the same host and trailing-slash style as your site uses.
- If a page has a Markdown version (
page.md), the spec prefers that. If not, the HTML page is fine. - Nothing that needs a login, and nothing you would not want quoted.
Minutes 20–27: descriptions that do the work
This is where the time goes, and it is the part that separates a useful file from a list of links. After each link, a colon and a single sentence. The formula is what the page is plus the one specific thing on it: a price, an area, a constraint, a number. Aim for 10–25 words. Do not repeat the page title; the link text already says that.
| Page | Weak description | Stronger description |
|---|---|---|
| Pricing | Our pricing. | Three fixed monthly plans from £120; the Starter plan covers up to 50 transactions a month. |
| About | Learn more about us. | Who runs the practice, our AAT registration, and the Leeds office address and hours. |
| Contact | Get in touch today! | Booking form for a free 20-minute call; we reply within one working day. |
| Guide | Helpful tips for small businesses. | When a UK sole trader has to register for VAT, with the current threshold and deadlines. |
Two habits make this faster. Write every description as if answering the question “why would an assistant open this page?”. And read the finished list top to bottom: if two descriptions could be swapped without anyone noticing, one of the pages does not need to be there.
Minutes 27–29: the Optional section
A final ## Optional section is a convention for links an assistant can skip when it is short on context. Since the v2 revision it has no special mechanical meaning, but it is still the right place for secondary material: a full-text bundle (llms-full.txt) if you publish one, versions of the site in other languages, legal pages, and a link to the spec. Do not put your pricing or your booking page here.
Minutes 29–30: save, check, publish
- 01
Save as llms.txt, UTF-8, with a newline at the end
Plain text only. On Windows, pick UTF-8 in Notepad's Save dialog; on a Mac, use TextEdit's plain-text mode or any code editor.
- 02
Run it through a validator
It catches the mistakes that stop a file being read at all: no H1 or two H1s, a section with no links, links without https://, a file served as HTML instead of text.
- 03
Upload it to the root of your site
It must answer at https://yoursite.com/llms.txt. Your platform's file manager, /public folder, or a redirect rule all work; the setup guides on this site cover the common hosts.
- 04
Test it the way the spec suggests
Paste only the file into an AI assistant and ask it three customer questions. If it answers correctly and names the right page, you are done. If not, the fix is almost always a description.
Check your draft before you upload
Paste the file into the validator to run the structural checks a strict parser applies: H1, summary, section and link format, size and encoding. Each finding comes with a fix.
Open the validator →A complete example
A made-up bookkeeping practice, using example.com addresses, written with the steps above. Swap the facts for your own and the structure carries over to a clinic, a shop, an agency or a personal site.
# Northgate Bookkeeping > Independent bookkeeping and VAT returns for sole traders and small limited companies in Leeds and West Yorkshire, since 2014. - We do not offer audit services or personal tax returns. - New clients start with a free 20-minute call; we do not quote by email. ## Services - [Monthly bookkeeping](https://example.com/services/bookkeeping): Bank reconciliation, invoicing and a monthly summary, from £120 a month. - [VAT returns](https://example.com/services/vat): Quarterly VAT preparation and filing for VAT-registered businesses. - [Year-end accounts](https://example.com/services/year-end): Statutory accounts and corporation tax filing for limited companies. ## Pricing - [Plans and prices](https://example.com/pricing): Three fixed monthly plans; the Starter plan covers up to 50 transactions a month. ## About and contact - [About the practice](https://example.com/about): Who runs it, our AAT registration, and the Leeds office address and hours. - [Book a call](https://example.com/contact): Booking form for the free 20-minute call; we reply within one working day. ## Guides - [When to register for VAT](https://example.com/guides/vat-threshold): The current registration threshold and what happens if you go over it mid-year. - [Sole trader or limited company?](https://example.com/guides/sole-trader-vs-ltd): The tax and admin differences, with a worked example. ## Optional - [Privacy policy](https://example.com/privacy) - [llms.txt specification](https://llmstxt.org/)
Twelve links, four sections, about 1.5 KB. It says what the business does and does not do, gives the two numbers a customer asks about first, and every description could be quoted as is.
Mistakes that show up in first drafts
- A slogan where the summary should be. “Your success is our passion” tells an assistant nothing it can repeat.
- Listing every page. Forty links with one-word descriptions is a sitemap, and the AI already has one.
- Descriptions that repeat the link text. “[Pricing](…): Pricing page” wastes the one sentence you had.
- Relative or tracking URLs.
/pricingcannot be fetched from the file;?utm_source=…creates a second URL for the same page. - Saving from a word processor. A
.docxrenamed to.txt, or curly quotes and invisible characters from a rich-text editor, can break the link syntax.
FAQ
Do I need to know Markdown to write llms.txt?
Only four pieces of it: a line starting with # for the title, a line starting with > for the summary, lines starting with ## for section names, and list items written as - [Page name](https://url): description. Everything else is plain text. If you can write an email, you can write this file.
How many links should a first llms.txt have?
Between 5 and 25 is the range most real files fall into, and a small business site is usually fine at 8–12. The number matters less than the selection: each link should be a page a customer might ask an assistant about. If you cannot write a specific one-sentence description for a page, it probably does not belong in the file.
Should the links point to .md files or normal pages?
The spec recommends linking to a Markdown version of each page where one exists, because it is cleaner for an AI to read. Most business sites do not have Markdown versions, and that is fine: link to the normal HTML page. Use the full https:// URL, the canonical version without tracking parameters, and never a page that needs a login.
Can I write llms.txt in Word or Google Docs?
You can draft it there, but save it as plain text (.txt) with UTF-8 encoding before uploading, and rename it to llms.txt. A .docx or an exported HTML file is not readable as llms.txt. On Windows, Notepad lets you pick UTF-8 in the Save dialog; on a Mac, TextEdit needs to be switched to plain-text mode first.
Does the file have to be at the root of the site?
For the file that describes your whole site, yes: https://yoursite.com/llms.txt. The v2 revision of the spec (August 2026) also allows a file at a sub-path such as /docs/llms.txt to describe the pages under that path, which large documentation sites use. A small site only needs the root file.
How do I know if what I wrote is any good?
Two tests. First, run it through a validator to catch structural mistakes such as a missing H1, a second H1, links without https://, or a file that is unexpectedly served as HTML. Second, the spec's own advice: paste only your llms.txt into an AI assistant and ask it questions a customer would ask. If it answers correctly and points to the right page, the file works.
Next steps
- → llms.txt for Shopify stores: what to put in it (the same method applied to a Shopify store, with the template Shopify expects)
- → The llms.txt spec, explained line by line (what is required, optional and unspecified)
- → llms.txt examples: 8 real files, annotated (see how Anthropic, Stripe and the spec author wrote theirs)
- → llms.txt complete guide (platform-by-platform upload instructions)
- → All Learn articles