LLMSdocs
English

llms.txt file format

The structure of an llms.txt file as defined by version 2.1 of the proposal: a required H1 title, an optional summary, Base URL line and details, then H2 sections of annotated links.

Type: ReferenceVersionllms.txt proposal v2.1
On this page
  1. Annotated example
  2. Elements
  3. Where the file goes
  4. Earlier versions
  5. Parsing a file
  6. See also
  7. References

Annotated example

Markdown
# Example Widgets

> Example Widgets is a JavaScript library for building form controls. This file indexes its documentation.

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

Before writing code with Example Widgets:

- Import widgets from the package; there is no global object.
- Every widget needs a container element with an id.

## Guides

Start here for installation and common tasks.

- [Installation](install.md): Package managers and browser builds
- [Quick start](quickstart.md): A complete form, step by step

## API reference

- [Widget options](api/options.md): Every option with its default
- [Events](api/events.md)

## External resources

- [Form accessibility notes](https://example.org/forms/accessibility.md)
A complete llms.txt for a documentation site at https://example.com/docs/llms.txt
  • Line 1 is the H1, the name of the project or site. It is the only element the proposal requires.
  • Line 3 is the blockquote summary. The proposal asks for key information needed to understand the rest of the file.
  • Line 5 is the Base URL line. Relative links such as install.md resolve to https://example.com/docs/install.md.
  • Lines 7 to 10 are details: ordinary Markdown that tells a reader how to use the project or the links below. Paragraphs, lists, code blocks and H3 or deeper headings are allowed here.
  • Each H2 starts a section. The Guides section opens with a one-sentence summary, which version 2.1 permits before the file list.
  • Each list item is a Markdown link, optionally followed by a colon and a note. The Events item has no note, which is allowed. The last link is absolute because it points to another host.

Elements

The proposal fixes the order of the elements. A file that follows it contains, from top to bottom:

ElementMarkdown formRequiredRules
Byte order markNoneNoAllowed at the very start of the file.
TitleH1: # NameYesThe name of the project or site. The only required element.
SummaryBlockquote: > textNoA short summary with the key information needed to read the rest of the file.
Base URLBase URL: https://example.com/docs/NoA standalone line in the top section. Parsers add a trailing slash if it is missing. Without it, relative links resolve against the URL the file was fetched from.
DetailsParagraphs, lists, code blocks, H3 and deeper headingsNoZero or more blocks. H1 and H2 are reserved and may not appear here.
SectionsH2: ## NameNoZero or more. Each may begin with a short summary paragraph, followed by a file list.
File list itemHyphen, a Markdown link, then an optional colon and notesLink required, notes optionalThe URL may be relative to the Base URL or the file's own URL, or absolute.

Where the file goes

The file is named llms.txt and can sit at the root, /llms.txt, or at any path, such as /docs/llms.txt. A file covers the URLs under its own path, and where more than one file applies, agents are expected to use the most specific. The proposal explains why it does not use /.well-known/: well-known URIs exist only at the origin root, and many authors control only a path on a shared host. Where site files live: the root path and /.well-known/ compares the two conventions.

Links in the file should point to content an agent can read directly, preferably Markdown versions of pages. The proposal places those at the page URL with .md appended or with the extension replaced by .md, and recommends a link with rel="alternate" type="text/markdown" on each page and rel="describedby" pointing to the llms.txt that covers it. See markdown versions of pages and llms-full.txt.

Earlier versions

Many published files were written against the 2024 text, so their structure differs from the table above. The proposal's own changes page lists what moved:

VersionDateChanges that affect the file
v1September 2024An H2 section titled Optional had a special meaning: tools that expanded the file into a single context could skip its links. The llms_txt2ctx tool did that expansion.
v2August 2026Defines subpath scoping and both .md URL forms, and adds the alternate and describedby link relations. Context-expansion tooling is no longer part of the proposal, so the Optional section loses its special meaning, though it remains allowed as a convention.
v2.1November 2026Adds relative links and the Base URL line, allows H3 and deeper headings in the details, and allows a summary paragraph at the start of each H2 section. The Optional convention is dropped from the text and examples in favor of descriptive headings.

A v1 file is still readable under v2.1: absolute links remain valid, and an H2 called Optional is now an ordinary section. llms.txt files from documentation sites shows files from documentation sites that still use it.

Parsing a file

Because the order of elements is fixed, a file can be parsed with ordinary string handling. The proposal's site documents a Python package, llms-txt, whose parse_llms_file function returns the title, summary, base URL, details and a dictionary of sections, each a list of links with title, url and desc fields. The same page shows a dependency-free parser of under 20 lines built on regular expressions.

Python
# pip install llms-txt
from pathlib import Path
from llms_txt import parse_llms_file

parsed = parse_llms_file(Path("llms.txt").read_text())
print(parsed.title, parsed.summary)
print(list(parsed.sections))
Reading the title and section names of a local llms.txt with the llms-txt package

The proposal is developed in the AnswerDotAI/llms-txt repository on GitHub, where changes are discussed in public.

See also

  • What llms.txt isllms.txt is a proposed Markdown file, usually served at /llms.txt, that gives language model tools a short description of a site and a curated list of links to read. It is a proposal rather than a standard, and it does not control crawling or training.
  • Markdown versions of pages and llms-full.txtThe llms.txt proposal asks sites to offer a clean Markdown copy of useful pages at the page's own URL with .md added, and to announce it with standard link relations. llms-full.txt, a single file holding a whole site, is a platform convention outside the proposal.
  • llms.txt files from documentation sitesSeven llms.txt files published by the proposal's author and by documentation teams at Anthropic, OpenAI, Google, Cloudflare and Stripe, retrieved on 5 December 2026 and compared section by section.
  • Where site files live: the root path and /.well-known/Clients find machine-readable site files at fixed addresses: some at the root of each host, some under the /.well-known/ prefix of RFC 8615, and some inside every page. Where a file sits also decides which URLs it can speak for.
  • Serving site files: media types, encoding and status codesWhich Content-Type each machine-readable file should be served with, why UTF-8 matters, and how crawlers react to redirects, client errors and server errors when they request robots.txt.

References

  1. Howard, J. The /llms.txt file, v2.1. First published 3 September 2024 llmstxt.org (accessed 5 December 2026)
  2. Changes. llmstxt.org (v2, August 2026; v2.1, November 2026) llmstxt.org (accessed 5 December 2026)
  3. Python module: Parse llms.txt files into structured Python objects. llmstxt.org llmstxt.org (accessed 5 December 2026)
  4. AnswerDotAI/llms-txt repository. GitHub github.com (accessed 5 December 2026)
  5. RFC 8615: Well-Known Uniform Resource Identifiers (URIs). IETF, May 2019 rfc-editor.org (accessed 5 December 2026)