
How to write an llms.txt file
Technical SEO · 9 min read · Updated 2026-06-15
Short answer: To write an llms.txt file, create a Markdown file at your domain root (yourdomain.com/llms.txt) that opens with an H1 of your name and a one-line `>` summary, then add `##` sections — About, Key Facts, Products, Services, Links — written as short, factual, self-contained statements an AI can lift verbatim. Keep it atomic, keep it true, and keep it current: it's a context file for AI crawlers, not a blocking file like robots.txt.
## what_it_is
What llms.txt is and why it helps citation
llms.txt is a proposed standard — published at llmstxt.org — for a single Markdown file at your domain root that hands AI crawlers a clean, curated summary of your site. Instead of forcing a model to infer who you are from cluttered HTML, navigation, and ad markup, you give it the answer directly: your name, what you do, your key facts, and links to the pages that matter.
It helps AI citation for the same reason a good first sentence does: language models cite what they can extract cleanly and confirm confidently. An llms.txt is the most extractable surface on your site — no boilerplate, no markup noise, just the facts you want repeated. When an engine can lift a clear statement of who you are and corroborate it against your structured data, it gets more confident about naming you in an answer.
llms.txt is not robots.txt
robots.txt tells crawlers what they may NOT access. llms.txt tells AI models what your site IS. One restricts; the other describes. Publishing llms.txt does not block anything, and it does not replace your sitemap — it sits alongside both.
## where_it_goes
Where the file goes
The file lives at the root of your domain, served as plain text: https://yourdomain.com/llms.txt. That fixed, predictable location is the whole point — an engine looking for your site's summary checks /llms.txt the way it checks /robots.txt, with no guessing. Serve it with a text/plain content type, keep it on your primary domain (not a subdomain unless that's your canonical home), and make sure it returns a 200, not a redirect chain.
Example: this site ships one
Advance Labs publishes its own llms.txt at https://advancelabs.dev/llms.txt — generated from the same facts that feed our structured data, so the two never drift. Open it in a browser to see a real one rendered.
## the_structure
The markdown structure
The format is intentionally minimal Markdown. There are only a few required pieces, and everything else is optional sections you add as needed:
- H1 — your name — A single # line with the name of the site or organization. This is the only required heading. Example: # Advance Labs Inc.
- > Blockquote summary — A one-sentence blockquote immediately under the H1 that summarizes what the site is, in plain language. This is the line most likely to be quoted, so make it self-contained.
- ## Sections — Each ## heading is a section: About, Key Facts, Products, Services, Links, and so on. Keep section bodies short — bullet lists or atomic statements, not prose paragraphs.
- Links as Markdown links — Where a section points at a page, use a real [label](url) Markdown link so the model can follow it to the full source.
## how_to_write_one
How to write one, step by step
01Start with your name and a one-line summary
Write a # H1 with your exact business name, then a > blockquote that says what you are in one self-contained sentence. If a model only read these two lines, it should still be able to describe you correctly.
02Add an About section
Under ## About, give two or three plain sentences: what you do, where you're based, and — critically — a disambiguation line if any same-named entity exists. State the official record (registry, incorporation number) so the engine can confirm which entity you are.
03Write Key Facts as atomic Q→A pairs
Under ## Key Facts, list the questions buyers actually ask and answer each in one line: "Q: What does X cost? A: $750–1,500, three-day turnaround." These are the most citable units in the file — one fact per line, no hedging.
04List Products, Services, and Guides
Add ## sections that link to your real pages with a short blurb each: - [Name](url): one-line description. Point at the canonical URL, not a tracking link.
05Finish with a Links section
Under ## Links, list your homepage, key indexes, and authoritative profiles (LinkedIn, GitHub, government registry). These corroborate your identity across sources.
06Publish at /llms.txt and keep it fresh
Serve the file at your domain root as text/plain. Then keep it current — ideally generate it from the same data that powers your schema so a fact changes in one place. A stale llms.txt is worse than none, because it gets quoted.
## worked_example
A worked example
Here is a compact, realistic llms.txt for a fictional local business. Note the H1 name, the one-line summary, the atomic Key Facts, and the linked sections — the same shape Advance Labs uses for its own file.
Example llms.txt
# North Ridge Roofing > North Ridge Roofing is a licensed roofing contractor in Hamilton, Ontario, specializing in residential roof replacement and emergency repair. ## About Family-run roofing contractor serving the Greater Hamilton Area since 2009. Licensed and insured in Ontario. Not affiliated with North Ridge Construction LLC (Denver, USA). ## Key Facts Q: What does a roof replacement cost? A: $8,000–$15,000 for a typical Hamilton home, completed in 1–3 days. Q: Do you offer emergency repair? A: Yes — 4-hour average response time, 24/7. Q: What areas do you serve? A: Hamilton, Burlington, Ancaster, Dundas, and Stoney Creek. ## Services - [Roof Replacement](https://northridgeroofing.ca/replacement): Full tear-off and re-roof, asphalt and metal. - [Emergency Repair](https://northridgeroofing.ca/repair): Leak and storm-damage repair, 24/7. ## Links - Website: https://northridgeroofing.ca - Google Business Profile: https://g.page/north-ridge-roofing - Reviews: https://northridgeroofing.ca/reviews
## best_practices
Best practices
- Keep it factual — Every line should be something you'd be comfortable seeing quoted in an AI answer. No marketing adjectives — "fast and trusted" never gets repeated; "4-hour average response" does.
- Make facts atomic — One fact per line, self-contained, no cross-references. Atomic Q→A pairs in Key Facts are the highest-leverage thing in the file.
- Disambiguate explicitly — If any same-named entity exists, say so in About. It's the cheapest way to stop an engine from confusing you with someone else.
- Keep it fresh — Treat it like an API response, not a brochure. Generate it from your source-of-truth data if you can, so a price or fact change updates it automatically.
- Don't dump your whole site — It's a curated summary, not a sitemap. Link to the pages that matter; leave the rest out.
| File | Purpose | Read by |
|---|---|---|
| llms.txt | Describes what the site IS — curated facts for AI context | AI assistants / LLM crawlers |
| robots.txt | Restricts what crawlers may access | Search + AI crawlers |
| sitemap.xml | Lists every URL for discovery and indexing | Search engine crawlers |
| Section | What it does | Required? |
|---|---|---|
| # H1 name | Names the site or organization | Yes |
| > Summary | One-line, quotable description | Recommended |
| ## About | Context + disambiguation + official record | Recommended |
| ## Key Facts | Atomic Q→A buyers ask — most citable | Recommended |
| ## Products / Services | Linked offerings with one-line blurbs | As needed |
| ## Links | Homepage + authoritative profiles | Recommended |
An llms.txt is a single plain-text file at one fixed location (/llms.txt). It does not require code, a plugin, or a crawl budget — which is why it's one of the lowest-effort, highest-clarity AEO moves available.
## faq
What is an llms.txt file?
It's a plain-text Markdown file published at your domain root (yourdomain.com/llms.txt) that gives AI assistants a concise, curated summary of your site — your name, what you offer, and your key facts. It helps models describe and cite you accurately by handing them clean, extractable information instead of forcing them to infer it from cluttered HTML.
Where do I put the llms.txt file?
At the root of your primary domain, served as plain text: https://yourdomain.com/llms.txt. The fixed location is the point — an engine checks /llms.txt the way it checks /robots.txt. Make sure it returns a 200 status with a text/plain content type, not a redirect.
Is llms.txt the same as robots.txt?
No. robots.txt restricts what crawlers may access; llms.txt describes what your site is. One blocks, the other informs. Publishing llms.txt doesn't block anything and doesn't replace your sitemap.xml — the three serve different purposes and coexist.
Does writing an llms.txt actually get me cited by AI?
On its own it's a helper, not a guarantee. It improves the chance an engine describes you accurately and stays current, especially when its facts match your Organization structured data so the two corroborate. It works best as one part of a fuller AEO setup — entity confirmation, extractable answers, and third-party mentions still matter.
## sources
## related_guides
## want_it_done_for_you
Want your llms.txt written and your whole AI-visibility surface checked — schema, extractable answers, and live AI-answer tests against your competitors? Our AEO audit runs the full 51-rule check and hands you a prioritized fix list. CAD $750–1,500, three days.
See the AEO audit