How to Write and Validate /llms.txt in 2026 (Complete Technical Guide)
A practical engineering breakdown of the llms.txt standard: required H1 and summary structure, common SPA soft-404 pitfalls, link verification, and automated mirroring.
Modern AI assistants and retrieval-augmented coding tools operate under strict token budgets. Instead of crawling dozens of JavaScript-heavy navigation shells, an AI agent can read a single root Markdown file — /llms.txt — to discover your canonical documentation, pricing, and API reference in one request.
What makes a spec-compliant /llms.txt
A valid /llms.txt follows a compact Markdown grammar:
- One top-level H1 heading (
# Brand Name) identifying your product or site. - A single-paragraph blockquote (
> ...) immediately under the H1 summarizing what the product does and who it serves. - Structured H2 sections (
## Docs,## Pricing,## Optional) grouping canonical URLs as standard Markdown list items (- [Title](https://...): concise note).
# Acme Cloud
> Edge infrastructure and developer APIs for low-latency web workloads.
## Core Documentation
- [Quickstart](https://acme.com/docs/quickstart.md): Deploy your first worker in 3 minutes
- [API Reference](https://acme.com/docs/api.md): REST endpoints and authentication
The 4 most common /llms.txt mistakes we catch in audits
- SPA soft-404 responses: React or Vite single-page apps frequently return
HTTP 200withContent-Type: text/htmland<div id="root"></div>for/llms.txt. Always verify both HTTP status andtext/markdownortext/plaincontent type. - Dead or redirected links inside the index: Hand-written
/llms.txtfiles rot quickly after doc restructures. Automated link checking catches404or looping entries before AI engines drop your citations. - Unstructured plain URL dumps: Bare URLs without section headers or titles force models to guess which page answers pricing vs API questions.
- Forgetting
/llms-full.txtor.mdmirrors: Pointing/llms.txtat noisy 400 KB HTML pages still wastes up to 85% of the model's context window on navigation and CSS.
Validate your site in 5 seconds
Run our free llms.txt Validator to inspect your live /llms.txt syntax line by line, test linked URLs, and copy a ready-to-deploy template — or upgrade to IndexMirror Starter to auto-sync /llms.txt and clean .md mirrors directly from your sitemap.