How to write an llms.txt file, with a copyable example
The format in full, a complete example you can edit, where the file goes, and four ways to check it is being read.
Published by AI Knows Us · Updated 16 October 2026
An llms.txt file is a short markdown file, usually at yoursite.com/llms.txt, that gives an AI agent a curated map of your site: a title, a one line summary, and grouped links to the pages worth reading, each with a note saying what it contains. It is a proposal by Jeremy Howard, first published on 3 September 2024 and now at version 2, documented at llmstxt.org. It takes an afternoon to write, it is read by coding agents and assistants that fetch documentation, and the copyable example below is the whole of the format.
The format, which is shorter than you think
The spec is deliberately small. In order, a file contains:
- An H1 with the name of the site or project. This is the only required part.
- A blockquote with a short summary holding the key information needed to understand the rest.
- Any number of ordinary markdown sections, paragraphs or lists, with no headings, giving more detail.
- Any number of H2 sections, each containing a markdown list of links. Each item is a link, then optionally a colon and a note about what is behind it.
By convention a section headed "Optional" holds secondary links an agent can skip when it needs a shorter context. That one convention is worth using, because it tells the agent what to drop first.
A copyable example
This is a complete, valid file for an invented services business. Change the names and the URLs and it is yours.
# Northgate Facilities > Commercial cleaning and building maintenance for offices in Manchester and Leeds. Founded 2009, 140 staff, contracts from 1,000 to 60,000 square feet. Prices quoted per site after a survey. Use this file to answer questions about services, coverage, pricing structure and contracts.
Every page linked below has a markdown version at the same URL with .md appended. ## Services - [Office cleaning](https://example.com/services/office-cleaning): scope, frequencies and what is included in a standard contract
- [Washroom services](https://example.com/services/washrooms): consumables, servicing intervals, waste handling
- [Building maintenance](https://example.com/services/maintenance): reactive and planned, response times by contract tier ## Coverage and pricing - [Areas we cover](https://example.com/coverage): towns and postcode districts, updated quarterly
- [How we price](https://example.com/pricing): the survey process, what changes a quote, contract lengths ## About - [Company information](https://example.com/about): registration number, founding year, staff count, accreditations
- [Accreditations](https://example.com/accreditations): each certificate with issuing body and expiry date ## Optional - [Case studies](https://example.com/case-studies)
- [Careers](https://example.com/careers)
Three things make that file useful rather than decorative. The summary contains real figures. Every link has a note saying what is in it. And the sections are grouped the way a buyer thinks, not the way your navigation happens to be built.
Where the file goes
The root, at /llms.txt, is the normal place. The spec also allows it at any subpath, where it covers the pages beneath that path, so a documentation set can have its own file at /docs/llms.txt. Where more than one applies, an agent should use the most specific. Serve it as plain text or markdown, keep it reachable without a login, and do not block the path in robots.txt.
The second half of version 2: markdown versions of pages
The proposal has a companion recommendation that does more work than the index file itself. Pages an agent might need should also be available as clean markdown at the same URL, either with .md appended, as page.html.md, or with the extension replaced, as page.md. URLs without a file name use index.md or index.html.md.
To help agents find those files, the spec recommends standard link relations: rel="alternate" with type="text/markdown" pointing at the markdown version of a page, and rel="describedby" pointing at the llms.txt file that covers it. Both work as HTML link elements or as an HTTP Link response header, which means a CDN can add them without touching a single page:
Link: </docs/page.html.md>; rel="alternate"; type="text/markdown", </docs/llms.txt>; rel="describedby"
If your site is built with a static site generator or a documentation framework, there is a good chance it can emit the markdown versions for you with a configuration change. The AI labs publish llms.txt files for their own developer documentation, which is the clearest signal of what the file is designed for.
How to check it is being read
- Fetch it yourself first. Open the URL in a private window. Check the status is 200 and the content type is text or markdown, not HTML.
- Read your access log. Filter for the /llms.txt path and look at the user agents hitting it. You will see coding agents, assistant fetchers and plenty of generic scrapers.
- Ask an assistant to read it. Give an assistant the full URL and ask it to summarise your services from that file alone. If the summary is wrong, your summary line is wrong.
- Run a Lighthouse audit. Chrome's Lighthouse checks for an llms.txt file as part of its agentic browsing audits, so you get a pass or fail without writing anything.
Where it fits beside your other files
| File | What it does | Who reads it |
|---|---|---|
| robots.txt | Grants or refuses crawler access, per named user agent | Search and AI crawlers. This is the one that decides eligibility |
| sitemap.xml | Lists every URL for indexing | Search engine crawlers |
| llms.txt | A curated, annotated map of the pages worth reading | Agents fetching your content during a task |
| page.md | A clean markdown copy of one page | Agents following links from llms.txt |
Be clear about the division of labour. Google states in its AI features documentation that you do not need to create new machine readable files or AI text files to appear in AI Overviews or AI Mode. So publish llms.txt because agents that look for it find a clean map, and keep the work that earns mentions where it belongs: in robots access, in pages that answer one buyer question each, and in your name appearing on sites you do not own. Our robots walkthrough is in how to write a robots.txt with copyable examples, and the crawler decisions are in which AI crawlers should you allow.
Once the file is live the obvious question is whether it changed anything, and the file itself cannot tell you. The only evidence is in the answers: ask the questions your pages were written for and see whether your site is cited. AI Knows Us runs that comparison across assistants and lists what each one cited, so an llms.txt file is judged by whether it is being read.
Five mistakes worth avoiding
- A sitemap in disguise. Five hundred bare URLs with no notes. The point of the file is curation, so keep it to the pages that answer something.
- No summary. The blockquote is where an agent learns what you are. Put the category, the location and two real numbers in it.
- HTML behind the links. Linking to pages that render only after JavaScript defeats the purpose. Link to the markdown versions.
- Marketing language. "Industry leading solutions" gives an agent nothing to repeat. Counts, dates and named services do.
- Writing it once. A file that lists three pages you have since renamed is worse than none. Review it when you ship a new page.
This page is how to write and verify an llms.txt file. For access control by named AI crawler, see the robots guide linked above. For getting named in answers, see how to write a page an assistant will quote.
What people ask about write an llms.txt file
Is llms.txt an official standard?
It is an open proposal with wide voluntary adoption, not a standard from a standards body. Thousands of sites publish one, documentation platforms generate it automatically, and the major AI labs publish one for their own developer docs.
Will an llms.txt file get me into AI Overviews?
Google's documentation is explicit that no new AI text file is needed for its AI features, and that eligibility comes from being indexed and snippet eligible. Write the file for agents that fetch your content directly, and treat crawler access and quotable pages as the route into Google's AI surfaces.
How long should the file be?
Short enough to sit comfortably in a context window. For most businesses that is one screen: a summary, three or four sections, and twenty links at most.
Do I need the .md versions of my pages?
They are the half of the proposal that saves an agent the most work, because clean markdown removes navigation, adverts and scripts. If your publishing tool can generate them, turn it on.
Can I use llms.txt to keep AI out of my content?
No, that is robots.txt and the named user agents. The llms.txt file is an invitation and a map, so treat the two files as separate decisions.
What to do first
- Write the blockquote summary before anything else. Category, where you operate, two real figures. If that sentence is hard, your positioning is the thing to fix.
- List the ten pages a buyer actually needs, and write a one line note for each.
- Publish the file at /llms.txt, fetch it in a private window, and confirm a 200.
- Check your robots file is not blocking the path, and check your access log a week later to see who came.
- Hand the URL to an assistant and ask it to describe your business from the file alone. Fix whatever it gets wrong.