Back to blog

How to Write and Validate /llms.txt in 2026 (Complete Technical Guide)

Nov 30, 2026IndexMirror Engineering

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:

  1. One top-level H1 heading (# Brand Name) identifying your product or site.
  2. A single-paragraph blockquote (> ...) immediately under the H1 summarizing what the product does and who it serves.
  3. 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 200 with Content-Type: text/html and <div id="root"></div> for /llms.txt. Always verify both HTTP status and text/markdown or text/plain content type.
  • Dead or redirected links inside the index: Hand-written /llms.txt files rot quickly after doc restructures. Automated link checking catches 404 or 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.txt or .md mirrors: Pointing /llms.txt at 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.