Skip to content
Ask Sera Search
Ask SeraAnswers from our guides, research and news Search
Learn
Guides
Research
Sectors
Platforms
News
Tools
About

How do I write an llms.txt file?

Write an llms.txt file in the llmstxt.org format: an H1, a summary, optional notes and H2 link lists. With a full example file and how to check it.

In short. Write a markdown file at /llms.txt with an H1 that names the site, a short summary in a blockquote, and H2 sections that list links to your main pages, each with a short note. The llmstxt.org format requires only the H1. Check the file with a validator before you publish it. Few AI systems request the file, so keep the effort small.

On this page 8 sections

The evidence

4 facts behind this guide: 3 confirmed, 1 observed
  • Confirmed:

    The llmstxt.org format requires only an H1 with the name of the project or site. The summary, notes and H2 file lists follow it in a fixed order.1llmstxt.org, Nov 28, 2026

  • Confirmed:

    Version 2.1 of the proposal, modified November 28, 2026, allows an optional Base URL line and a file at any path, which covers the pages under that path.1llmstxt.org, Nov 28, 2026

  • Observed:

    Of about 38,000 domains with a valid llms.txt file, 97% received no requests for it in May 2026.3Ahrefs, Jun 15, 2026. Web Analytics and Bot Analytics data for 137,210 domains

  • Confirmed:

    Google says Google Search does not use llms.txt or other AI text files, and that creating them for other services is fine.4Google Search Central

Confirmed by the platformObserved in data

To write an llms.txt file, put an H1, a summary and lists of links to your main pages in a markdown file at /llms.txt. The format comes from the llms.txt proposal on llmstxt.org, which reached version 2.1 on November 28, 2026.1 The file gives an agent a short guide to a site, and the detail stays behind the links.

#What goes in an llms.txt file?

An llms.txt file holds these parts, in this order, and only the H1 is required. The proposal lists them as follows:1

  1. An optional byte-order mark.
  2. An H1 with the name of the project or site.
  3. A blockquote with a short summary that holds the information needed to understand the rest of the file.
  4. An optional line Base URL: https://.../, which sets the base for relative links. Without it, relative links resolve against the address of the llms.txt file.
  5. Zero or more blocks of detail: paragraphs, lists, code blocks or H3 and lower headings. H1 and H2 are reserved.
  6. Zero or more sections under H2 headings. Each has an optional short summary, then a "file list": a markdown list in which each item is a link, optionally followed by a colon and notes.

The fixed order lets programs parse the file with ordinary methods such as parsers and regular expressions, while people and language models can still read it as markdown.1

#How do I write an llms.txt file?

Choose a location, write the top section, add the link lists, then publish markdown versions of the linked pages.

#Step 1: Choose the location

Put the file at /llms.txt to cover the whole site. The proposal also allows a file at a subpath, such as /docs/llms.txt, which covers only the pages under /docs/. Where more than one file applies, agents should use the most specific one.1

#Step 2: Write the H1 and the summary

Start with # and the name of the site. On the next block, write a one-paragraph summary as a blockquote, with > at the start of the line. Say what the site is and what the linked pages cover, in plain words. The proposal advises concise, clear language and no unexplained jargon.1

#Step 3: Add the base URL and notes

Add a Base URL: line if you want to use relative links. Then add any notes that help an agent read the links, such as which product versions the pages cover. Use paragraphs or lists, and do not use H1 or H2 headings in this part.

Group your main pages under H2 headings such as "Docs", "Products" or "Policies". Under each heading, list one link per line in the form - [Name](url): note. Give each link a brief, informative description.1 List the pages that answer the questions people ask about you, and leave out the rest. The file should stay small enough to fit in an agent's context.

#Step 5: Publish markdown versions of the pages

The proposal recommends a clean markdown copy of each page at the same address, with .md added (page.html.md) or replacing the extension (page.md). Addresses without a file name add index.html.md or index.md. It also recommends rel="alternate" type="text/markdown" links to the markdown copy and rel="describedby" links to the llms.txt file, in HTML or in an HTTP Link: header.1 Point the links in llms.txt at the markdown copies where you have them.

#What does a complete llms.txt file look like?

This example covers a small software company. Replace the names, the base URL and the paths with your own.

Text
# Example Analytics

> Example Analytics is a web analytics service for small online stores. The pages below describe its features, setup, pricing and API.

Base URL: https://www.example.com/

Each page has a markdown version at the same address with .md added.
The documentation covers version 3 of the tracking script.

## Docs

- [Quick start](docs/quick-start.html.md): Install the tracking script and see the first report
- [Reports](docs/reports.html.md): What each report shows and how it counts visits

## API

- [API reference](docs/api.html.md): Endpoints, authentication and rate limits

## Company

- [Pricing](pricing.html.md): Plans and what each one includes
- [Support](support.html.md): Support hours and how to contact the team

Developer documentation is the most common use. The proposal says llms.txt files are used most for software documentation, where coding agents follow them to API references and tutorials.1 OpenAI's crawler documentation, for example, opens with a pointer to its own llms.txt index and says markdown versions of its pages are available with .md added.5

#How do I check my llms.txt file?

Check the structure with a validator, check that the server returns the file, then test it with an agent.

  1. Enter your domain in the llms.txt checker. It shows whether the file has the H1, summary, sections and link lists that the llmstxt.org format sets out.
  2. Check that the server answers with the file and not with an error. Chrome's Lighthouse audit for llms.txt flags a page when a server error occurs as it fetches the file. A missing file (a 404) marks the audit as not applicable, because the file is optional.2
  3. Open each link in the file and confirm that it loads.
  4. Give an agent only your llms.txt file and ask it questions about your content. The proposal suggests this test.1
  5. Update the file when you add, move or remove a main page, so the links stay current.

#Do AI systems read llms.txt files?

Few do, and there is no evidence that the file helps a site get cited in AI answers. The Ahrefs llms.txt study found that of about 38,000 domains with a valid llms.txt file, 97% received no requests for it in May 2026. AI retrieval bots such as OAI-SearchBot and PerplexityBot made 1.1% of the requests that did arrive.3 Google's guide to generative AI features in Search says Google Search does not use llms.txt or other AI text files, and that it is fine to keep such files for other services that use them.4 In our crawl of the sites that AI answers cited in October and November 2026, 39.56% of 7,192 domains had a valid file. Those domains received 41.59% of the citations, about the same as their share of domains. Does llms.txt help AI visibility? gives the full evidence. If your users work with coding agents, a short file costs little to keep. Spend most of the effort on crawler access and page text.

Read next

Check your site

Terms in this guide

Questions

Where do I put the llms.txt file?

At /llms.txt in the root of the site, or at a subpath such as /docs/llms.txt. The llmstxt.org proposal says a file covers the URLs under its path, and agents should use the most specific file when more than one applies.

Does an llms.txt file need markdown versions of my pages?

No, but the proposal recommends them. It suggests a clean markdown version of each page at the same URL with .md added, and says the links in llms.txt should point to content that language models can read easily.

Does llms.txt replace robots.txt or a sitemap?

No. robots.txt tells crawlers what access is acceptable, and a sitemap lists the indexable pages of a site. The proposal describes llms.txt as a curated overview that agents read when they need it.

About this page

Researched and reviewed by Promptly Found. Reviewed Dec 1, 2026. Next review due Mar 2027.

Notes

  1. 1
    The /llms.txt file, v2.1llmstxt.org · Nov 28, 2026 · Checked Dec 1, 2026 · Primary source
  2. 2
    How the llms.txt audit worksChrome for Developers · Checked Dec 1, 2026 · Primary source
  3. 3
    We Analyzed 137K Sites: 97% of llms.txt Files Never Get ReadAhrefs · Jun 15, 2026 · Checked Dec 1, 2026 · Dataset
  4. 4
    Optimizing your website for generative AI features on Google SearchGoogle Search Central · Checked Dec 1, 2026 · Primary source
  5. 5
    Overview of OpenAI CrawlersOpenAI · Checked Dec 1, 2026 · Primary source
Cite this page
Citation style

Promptly Found. (2026, December 1). How do I write an llms.txt file? https://promptlyfound.com/geo/how-to-write-llms-txt

Revisions 1
First published. Format checked against version 2.1 of the llmstxt.org proposal.