llms.txt is a small Markdown file at the root of a site that tells AI tools what the site is and which pages matter. You can write it by hand, script it from your sitemap for free, or generate it together with llms-full.txt (all your pages as Markdown) in one run.
What goes in an llms.txt file
The llms.txt proposal asks for a Markdown file at /llms.txt with an H1 (the site or project name), a short summary in a blockquote, then sections of links with one line each. A common companion is llms-full.txt: the content of all the pages in one Markdown file, so a model can read the docs in one go.
It's a proposal, not a standard. Some AI tools and docs platforms read it; many crawlers don't. It costs little to publish, and it's most useful for docs sites that people paste into coding assistants.
Free way 1: write it by hand
For a small site, open a text file, write the name, one sentence about the site and a list of your 10 to 20 most useful pages. Ten minutes, and you control every word.
Free way 2: build it from your sitemap with Python
This reads every URL in your sitemap, takes each page's title and meta description, and writes llms.txt:
import html, re, requests
SITEMAP = "https://example.com/sitemap.xml"
urls = re.findall(r"<loc>(.*?)</loc>", requests.get(SITEMAP, timeout=30).text)
def title_and_description(url):
page = requests.get(url, timeout=30).text
t = re.search(r"<title[^>]*>(.*?)</title>", page, re.S)
d = re.search(r'<meta[^>]+name="description"[^>]+content="([^"]*)"', page)
return (html.unescape(t.group(1).strip()) if t else url), (html.unescape(d.group(1)) if d else "")
pages = [(u, *title_and_description(u)) for u in urls]
home_title, home_desc = pages[0][1], pages[0][2]
lines = [f"# {home_title}", "", f"> {home_desc}", "", "## Pages", ""]
lines += [f"- [{t}]({u})" + (f": {d}" if d else "") for u, t, d in pages[1:]]
open("llms.txt", "w").write("\n".join(lines) + "\n")
We ran it on this site's own sitemap: 46 pages in 21.7 seconds. Where it stops: it fetches one page at a time, doesn't follow sitemap indexes, gets nothing useful from pages that need JavaScript to render, puts everything in one section, and doesn't make llms-full.txt, which needs each page's main content turned into clean Markdown.
The API way: llms.txt and llms-full.txt in one run
- Open the Website to Markdown API on Apify.
- Paste your sitemap URL (or a start page and turn on Crawl), and set Max pages.
- Turn on llmsTxt and click Start.
- Download
llms.txt and llms-full.txt from the run's key-value store (Storage tab). Each page is also in the dataset as Markdown, with its title, description and token count.
curl -X POST "https://api.apify.com/v2/acts/blueberry_rainstorm~web-page-to-markdown/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sitemapUrls": [
{
"url": "https://docs.example.com/sitemap.xml"
}
],
"maxPages": 500,
"llmsTxt": true
}'
What a generated llms.txt looks like (from a test run on one Python docs page, 24 November 2026):
# Python documentation
> Source code: Lib/json/__init__.py JSON (JavaScript Object Notation), specified by RFC 7159 ...
## Pages
- [json — JSON encoder and decoder](https://docs.python.org/3/library/json.html): Source code: Lib/json/__init__.py JSON (JavaScript Object Notation) ...
Pages are grouped into sections by their first folder below the folders all pages share (for example /guide/ and /api/), and the summary comes from the start page's description. Edit the result by hand before you publish it; it's a good first draft, not a finished text.
What it costs
$1 per 1,000 pages converted. The llms.txt and llms-full.txt files cost nothing extra. A 300-page docs site costs $0.30. Apify's free $5 monthly credit covers about 5,000 pages.
Limits
- Pages behind a login are not read.
- The summary is only as good as your start page's meta description; rewrite it if it's vague.
- Publishing the file is up to you: put both files at your site root (e.g.
https://example.com/llms.txt).
Only need one page as Markdown? Use the free HTML to Markdown converter, or read the website to Markdown API guide for RAG.
Questions
How do I create an llms.txt file?
Write a Markdown file with your site name as an H1, a one-line summary in a blockquote, and a list of your key pages with a short description each, then publish it at /llms.txt. A script can build it from your sitemap, and the Website to Markdown API generates it together with llms-full.txt.
What is the difference between llms.txt and llms-full.txt?
llms.txt is a short index: name, summary and links. llms-full.txt contains the full text of the pages as Markdown in one file.
Is there a free llms.txt generator?
Yes: write it by hand, or run the Python script above on your sitemap. The API version costs $1 per 1,000 pages, and Apify's free credit covers about 5,000 pages a month.
Do ChatGPT and Google use llms.txt?
llms.txt is a proposal, and support varies by tool. It's most useful for docs that developers paste into AI assistants, and it doesn't replace a normal sitemap or robots.txt.