How to Create and Format an llms.txt File: The Complete Syntax and Markdown Guide

How to Create and Format an llms.txt File: The Complete Syntax and Markdown Guide
📋 Quick Summary

A complete, copy‑paste‑ready guide to writing an llms.txt file from scratch. Learn the exact Markdown syntax, how to structure your site's description, links, and lists, and where to place the file so AI tools like ChatGPT and Gemini can read it perfectly.

1. What Makes llms.txt Different from Other Config Files

Most web configuration files speak in XML, JSON, or plain key-value pairs. llms.txt does none of that. It is written entirely in Markdown — the same lightweight formatting language that powers GitHub READMEs, Notion pages, and developer documentation. That design choice is not accidental.

Beginner's Guide to llms.txt: What It Is and Why Your Site Needs It covers why this file exists at all. The short version: large language models like ChatGPT, Claude, and Gemini increasingly visit websites to synthesize answers in real time. Parsing a page full of nested <div> tags, ads, and JavaScript is expensive and imprecise. A clean Markdown file at your root gives those models exactly what they need without the noise.

Markdown is also "token-efficient." Every character an LLM reads costs compute. A terse, well-structured Markdown file delivers maximum information per token. That is why the specification — maintained at llmstxt.org — chose Markdown over XML or JSON, and it is why you should write this file by hand rather than auto-generate it with a CMS plugin that buries the content in boilerplate.

Key insight: llms.txt is a content guide, not a permissions file. It does not block crawlers — that is robots.txt's job. It curates and summarises your best content for AI inference. If you want to also learn how crawlers discover and index that content, read How AI Search Engines Crawl the Web: RAG, Vector Databases, and the Role of llms.txt.

2. The Exact File Name and Placement Rules

Before touching the Markdown itself, get two non-negotiable details right: the file's name and its location on the server.

File name

The file must be named exactly llms.txt. Lowercase, no spaces, no underscores, no version numbers. The name is case-sensitive on most Linux-based hosts. LLMs.txt, LLMS.TXT, or llmstxt.md will not be recognised by tools that follow the specification.

File location

Place the file in the root directory of your website so it is accessible at https://yourdomain.com/llms.txt. Placing it inside a subfolder like /blog/llms.txt breaks the convention — AI systems look for it at the root, mirroring how they find robots.txt. Subfolders simply will not register for the main domain.

Platform note: On WordPress, upload the file to the same folder that contains wp-config.php. On Blogger or other hosted platforms where root-level file access is restricted, use the free llms.txt Generator to build and then host the file via a custom subdomain or a publicly accessible URL you control.

After uploading, verify by navigating directly to https://yourdomain.com/llms.txt in your browser. You should see raw Markdown text, not a 404 error or a rendered HTML page.

3. The H1: The Only Required Markdown Element

Every valid llms.txt file must start with a single H1 heading. It is the only element that the specification marks as strictly required. Everything else is optional, though each additional piece adds useful context.

Syntax

In Markdown, you create an H1 by typing a single hash symbol (#) followed by a space and then your text. Do not use two hashes (##) — that is H2 and carries different semantic weight in the specification.

# Your Site or Project Name

The H1 should contain the name of your site, brand, or project — not a tagline, not a keyword-stuffed phrase. Think of it as the title on a business card. If your site is called "ToolFast," write # ToolFast. If it is a SaaS product called "DataPulse Analytics," write # DataPulse Analytics.

Rule: Use exactly one H1. The specification is explicit — a second # heading later in the file is a format violation. If you need to group content, use H2 (##) sections instead.

What the H1 signals to an AI

When a language model or AI agent parses your file, the H1 is the first thing it reads. It anchors everything that follows. The model uses it to understand whose content it is looking at, which matters for citation accuracy. A generic H1 like # Website provides no signal. A precise H1 like # ToolFast – Free Web Dev & SEO Tools gives the model immediate brand context before it processes a single link.

4. The Blockquote: Your Site's Elevator Pitch

Directly after the H1, you should place a blockquote containing a short summary of your site. The specification describes this as "a short summary of the project, containing key information necessary for understanding the rest of the file." It is the single most important prose element in the entire file.

Syntax

In Markdown, a blockquote is created by starting a line with the greater-than symbol (>) followed by a space and then your text. Multi-line blockquotes each begin with >.

> ToolFast provides free, browser-based tools for web developers and
> SEO professionals — covering Markdown conversion, HTML formatting,
> keyword extraction, and AI content preparation.

You can write the same content on a single line for brevity:

> ToolFast provides free browser-based tools for web developers and SEO professionals.

What to write in the blockquote

Aim for one to three sentences. Cover: (1) what your site or product is, (2) who it serves, and (3) the primary value it delivers. Do not use marketing superlatives. Write for a model that is trying to decide whether your site is relevant to a user query — clarity beats persuasion here.

Important: The blockquote is the only section besides the H1 that is structurally parsed by tools and agents that follow the spec. Every other prose element is treated as free-form context. This makes the blockquote disproportionately important — write it carefully.

5. Free-Form Content Block: Paragraphs and Lists

Between the blockquote and your first H2 section, the spec allows "zero or more markdown sections of any type except headings." This area is your chance to provide additional context: who the site is for, any licensing notes, the content language, or guidance on how to interpret the links that follow.

Plain paragraphs

Write plain text with a blank line between paragraphs. No special syntax needed.

> ToolFast is a free online toolbox for developers and SEO practitioners.

All tools run in the browser with no sign-up required. Content is
published in English. Tools are updated monthly.

This file lists the most important pages for AI reference. For a
full site index, see the sitemap at https://www.toolfast.net/sitemap.xml

Unordered lists

If you want to call out key facts as bullets, use a hyphen (-) followed by a space. You can also use an asterisk (*) — both are valid Markdown list markers.

- Audience: web developers, SEO professionals, content creators
- Language: English
- License: Free to use, no attribution required
- Updated: monthly

Inline emphasis

Standard Markdown inline formatting works inside this block. Use *italic* or _italic_ for emphasis, and **bold** for strong emphasis. Keep usage minimal — you are writing for a machine, not designing a brochure.

Restriction: Do not place any additional headings (lines starting with #) inside this free-form block. The spec explicitly prohibits heading elements here. The next heading in your file should be your first ## H2 section.

6. H2 Sections and Structured Link Lists

This is where llms.txt moves from description to directory. After your free-form block, you create one or more H2-headed sections, each containing a Markdown list of links. These sections tell an AI exactly which pages to read for which topic.

H2 section syntax

Create an H2 with two hash symbols (##) followed by a space and a descriptive section name. Common section names include ## Guides, ## Tools, ## Documentation, ## Blog, and ## API. Choose names that reflect your actual site structure.

## Guides

Link list syntax

Under each H2, list your links as an unordered Markdown list. Each item follows this pattern:

- [Link Text](https://full-url.com): Optional one-line description

The square brackets contain the link text a model will display when citing. The parentheses contain the full absolute URL. The colon and the text after it are optional — but highly recommended — because they tell the model what the page covers without it having to fetch and read the page first.

A complete H2 section example

## Guides
- [Beginner's Guide to llms.txt](https://www.toolfast.net/2026/07/beginners-guide-to-llmstxt-what-it-is.html): What llms.txt is, why it matters, and how AI reads it
- [How AI Search Engines Crawl the Web](https://www.toolfast.net/2026/07/how-ai-search-engines-crawl-web-rag.html): RAG, vector databases, and the role of llms.txt

## Tools
- [llms.txt Generator](https://www.toolfast.net/2026/07/llmstxt-generator.html): Generate a ready-to-upload llms.txt file in seconds
- [Markdown to HTML Converter](https://www.toolfast.net/2026/06/markdown-to-html-converter-online.html): Convert Markdown files to valid HTML instantly

How many sections and links?

There is no hard limit. For a blog or small site, two to four H2 sections with five to fifteen links total is enough. For a large documentation site, you might have ten sections. The guiding principle: include only pages that deliver genuine informational value. Skip thin pages, paginated archives, tag clouds, and contact forms — these waste an AI's context window and dilute the signal quality of your file.

Pro tip: Where possible, link to the .md version of a page rather than its HTML version. A URL like https://example.com/guide.html.md gives the AI a clean Markdown document to read instead of forcing it to parse HTML. The llms.txt specification explicitly recommends this companion-file approach.

7. The Special "Optional" Section

The specification reserves one H2 section name with a specific machine-readable meaning: ## Optional. Links placed under this heading carry a signal to AI agents that says: "If you are running low on context window space, you can safely skip these links."

## Optional
- [About ToolFast](https://www.toolfast.net/p/about.html): Background on the team and the project's history
- [Privacy Policy](https://www.toolfast.net/p/privacy-policy.html): Data handling and cookie policy details

Use this section for content that is useful context but not essential for answering most user queries — author bios, legal pages, archived posts, or secondary reference material. The ## Optional label is case-sensitive; write it exactly as shown.

8. Markdown Syntax Reference Table

Element Markdown Syntax Position in File Required?
Site / Project Name # Site Name Line 1 (always first) ✅ Yes
Summary Description > One-paragraph summary Immediately after H1 Strongly recommended
Free-form paragraphs Plain text, blank line between blocks After blockquote, before first H2 Optional
Bullet list (context) - item text After blockquote, before first H2 Optional
Section heading ## Section Name After free-form block; repeatable Recommended
Link with description - [Text](URL): Note Under each H2 section Recommended
Link without description - [Text](URL) Under each H2 section Optional
Optional section ## Optional Last section Optional
Bold emphasis **bold text** Anywhere in prose Optional
Italic emphasis *italic text* Anywhere in prose Optional
Inline code `inline code` Anywhere in prose Optional

9. Common Formatting Mistakes to Avoid

  • Multiple H1 headings. The spec allows exactly one # heading. A second one breaks parsing in tools that process the file programmatically.
  • Using YAML front matter. Do not add --- front matter blocks at the top of the file. llms.txt is plain Markdown — no YAML, no JSON, no HTML.
  • Relative URLs in links. Always use full absolute URLs (starting with https://). An AI agent that reads your file has no base URL context to resolve relative paths like /blog/post.html.
  • Heading inside the free-form block. Any text between the blockquote and your first ## must not contain heading syntax. Paragraphs and lists only.
  • Placing the file in a subfolder. The file must live at the domain root. A path like /content/llms.txt will not be discovered by crawlers following the standard.
  • Dumping every URL on the site. More is not better. Keep the file focused on your highest-value pages. An llms.txt with 300 links provides almost no curation signal and wastes the model's context budget.
  • Forgetting to update it. When you publish major new guides or restructure your site, revise your llms.txt file. Treat it like a living document, not a one-time setup task.

Shortcut: If you want to skip manual writing entirely, the free llms.txt Generator at ToolFast walks you through a form, validates your inputs, and produces a ready-to-upload file that conforms to all the rules above.

10. Complete Ready-to-Copy llms.txt Template

Below is a full, spec-compliant llms.txt template. Replace every placeholder in [square brackets] with your own content. The structure follows the exact order mandated by the specification: H1 → blockquote → free-form block → H2 sections → Optional section.

# [Your Site or Brand Name]

> [One-to-three sentence summary of what your site does, who it serves,
> and the primary value it provides. Write for an AI agent, not a human
> marketing audience. Be precise and factual.]

[Optional: 1–2 short paragraphs or a bullet list with extra context.
For example: the site's primary language, update frequency, licensing
notes, or how the AI should interpret the links below.]

- Audience: [describe your target readers]
- Language: [English / Spanish / etc.]
- Updated: [monthly / quarterly / etc.]

## [Section Name — e.g. Guides]
- [[Page Title](https://yourdomain.com/full-url)]: [One-line description of what this page covers]
- [[Page Title](https://yourdomain.com/full-url)]: [One-line description]
- [[Page Title](https://yourdomain.com/full-url)]: [One-line description]

## [Section Name — e.g. Tools]
- [[Tool Name](https://yourdomain.com/tool-url)]: [What this tool does in one sentence]
- [[Tool Name](https://yourdomain.com/tool-url)]: [What this tool does in one sentence]

## [Section Name — e.g. Documentation]
- [[Doc Title](https://yourdomain.com/docs/page)]: [What this doc explains]
- [[Doc Title](https://yourdomain.com/docs/page)]: [What this doc explains]

## [Section Name — e.g. Blog]
- [[Post Title](https://yourdomain.com/blog/post)]: [What question this post answers]
- [[Post Title](https://yourdomain.com/blog/post)]: [What question this post answers]

## Optional
- [[About Page](https://yourdomain.com/about)]: Background on the team and site mission
- [[Privacy Policy](https://yourdomain.com/privacy)]: Data handling and cookie policy

Here is the same template filled in as a real-world example for a web dev tools site like ToolFast:

# ToolFast

> ToolFast is a free, browser-based toolbox for web developers and SEO
> professionals. It provides instant-use tools for Markdown conversion,
> HTML formatting, CSS and JS minification, keyword extraction, and
> AI-ready content preparation — all without sign-up or installation.

- Audience: web developers, front-end engineers, SEO practitioners, bloggers
- Language: English
- Tools: 30+ free browser tools, no account required
- Updated: new tools added monthly

## Guides
- [Beginner's Guide to llms.txt: What It Is and Why Your Site Needs It](https://www.toolfast.net/2026/07/beginners-guide-to-llmstxt-what-it-is.html): Introduction to the llms.txt standard, its purpose, and how AI systems use it
- [How AI Search Engines Crawl the Web: RAG, Vector Databases, and the Role of llms.txt](https://www.toolfast.net/2026/07/how-ai-search-engines-crawl-web-rag.html): Technical explainer on RAG pipelines and how llms.txt slots into AI retrieval
- [How to Create and Format an llms.txt File](https://www.toolfast.net/2026/07/how-to-create-and-format-llmstxt-file.html): Step-by-step syntax and Markdown guide for writing a valid llms.txt file

## Tools
- [llms.txt Generator](https://www.toolfast.net/2026/07/llmstxt-generator.html): Generate a spec-compliant llms.txt file via a guided form
- [Markdown to HTML Converter](https://www.toolfast.net/2026/06/markdown-to-html-converter-online.html): Convert Markdown source files to valid HTML in the browser
- [HTML Formatter](https://www.toolfast.net/2026/03/html-formatter-beautify-and-format.html): Beautify and indent raw HTML for readability and debugging
- [CSS Minifier](https://www.toolfast.net/2026/04/css-minifier.html): Remove whitespace and comments from CSS to reduce file size
- [JS Minifier](https://www.toolfast.net/2026/04/js-minifier.html): Minify JavaScript files for faster page load performance
- [Keyword Extractor](https://www.toolfast.net/2026/04/keyword-extractor.html): Extract primary and secondary keywords from any block of text
- [Preview HTML Code Online](https://www.toolfast.net/2026/04/preview-html-code-online.html): Render raw HTML in a live preview pane without leaving the browser

## Optional
- [CleanLinker](https://www.toolfast.net/2026/07/cleanlinker.html): Strip tracking parameters and clean URLs for sharing
- [About ToolFast](https://www.toolfast.net/): Homepage and tool directory overview

Validation tip: After building your file, paste its contents into the llms.txt Generator preview pane to verify the structure renders correctly. You can also use the Markdown to HTML Converter to visually inspect how the heading hierarchy and link lists will appear when parsed.

FAQ

What markdown format does llms.txt use?

llms.txt uses plain Markdown — no YAML, no JSON, and no HTML. The file structure follows a strict order: an H1 heading (#) with your site name, a blockquote (>) summary, an optional free-form block of paragraphs and unordered lists, and then one or more H2 sections (##) each containing a Markdown link list in the format - [Text](URL): description. Standard inline Markdown such as bold (**text**), italic (*text*), and inline code (`code`) is also valid. The only restriction is that no additional heading elements are allowed inside the free-form content block between the blockquote and the first H2 section.

Where should I upload my llms.txt file?

The file must be placed in the root directory of your domain so it is accessible at the URL https://yourdomain.com/llms.txt. This mirrors how robots.txt is expected to live at the root. Placing it in a subfolder (e.g., /blog/llms.txt) will prevent AI crawlers and tools following the specification from detecting it. Each subdomain also needs its own separate file — models do not automatically look "up" from a subdomain to the apex domain. After uploading, verify access by visiting the URL directly in your browser; you should see raw Markdown text, not a 404 page.