How to Create an llm.txt File for Your Website

So you’ve decided your website needs an llm.txt file. Good call. AI agents are crawling the web constantly, and a well-structured llm.txt is the fastest way to help them understand what your site is about without wasting tokens on navigation, footers, and ads.

This guide walks you through the process from empty file to deployed and verified. No theory, no detours.

Just the six steps you need, a complete example you can adapt, and a short list of mistakes that will silently break your file.

If you haven’t already, read our explainer on what an llm.txt file actually is before you start. The rest of this guide assumes you know the basics.

What You’ll Need

Three things, nothing fancy:

  • A plain text editor (VS Code, Sublime, Notepad, TextEdit, anything that saves as UTF-8)
  • Access to your web server’s root directory (FTP, SSH, or your hosting dashboard’s file manager)
  • A short list of the most important URLs on your site: ten to thirty, not hundreds

That’s it. You don’t need any special software or a build step. An llm.txt file is just a Markdown file you write by hand.

Step 1: Pick the File Location

Your llm.txt file has to live at the exact path /llms.txt. Note the plural, with an s.

It goes at the root of your domain, the same place as robots.txt and sitemap.xml.

So if your site is example.com, the file must be reachable at https://example.com/llms.txt. Nowhere else. Subdirectories won’t be discovered by crawlers, and any location that isn’t the root is effectively invisible to AI agents following the specification.

Step 2: Write the H1

Every llm.txt file starts with a single H1 that names your project or site. This is the only required element in the entire specification.

Keep it short and descriptive. The product or company name, nothing more:

# Acme Analytics

Don’t add a tagline on the same line, don’t use emojis, don’t use all caps. The H1 is what an AI agent sees first, and it should read as a clean identifier, not marketing copy.

Step 3: Add a One-Paragraph Site Summary

Directly under the H1, add a Markdown blockquote with a one-paragraph summary of what your site does. This is the context the agent needs to decide whether your content is relevant to the query it’s working on.

> Acme Analytics is a privacy-first web analytics tool for small business 
> owners who want to understand visitor behavior without cookies or tracking scripts.

Two sentences max. Focus on what you do and who it’s for.

Skip adjectives like “best-in-class” or “innovative”. They carry no information an agent can use.

Scrabble tiles spelling AI on a wooden surface, representing how an llm.txt file is assembled from small structured pieces for AI agents to read

Step 4: Organize URLs into H2 Sections

Now the real work.

Group the most important URLs on your site into logical H2 sections, typically Docs, Blog, API, Product, or whatever categories make sense for your content.

Each section contains a bulleted Markdown list. Each list item uses the [link text](url): optional description format:

## Docs

- [Getting Started](https://example.com/docs/start): A 5-minute quickstart
- [API Reference](https://example.com/docs/api): Complete endpoint docs
- [Authentication](https://example.com/docs/auth): OAuth2 setup guide

The descriptions after the colon are what make llm.txt valuable. An agent reading this knows immediately which page answers its question, without having to fetch and parse every URL first.

Curate ruthlessly. Your sitemap.xml lists every page on your site; your llm.txt should list only the pages you actually want an agent to read. If you’re tempted to dump 200 URLs here, you’re doing it wrong. Pick the essential ten to thirty and convert each linked page to clean markdown if you want to go further and host markdown versions alongside the HTML.

Step 5: Add an “Optional” Section

The specification defines one special H2: ## Optional. URLs listed here are treated as lower-priority context that an agent can safely skip when it’s working with a tight context window.

## Optional

- [Changelog](https://example.com/changelog): Release history
- [Team page](https://example.com/about/team): Who works here

Use Optional for supporting content that’s nice to have but not essential: changelogs, team pages, old blog posts, press kits.

Anything an agent can skip without losing the ability to answer questions about your core product belongs here.

Step 6: Upload and Verify

Save the file as llms.txt and upload it to the root of your web server, the same directory that contains your homepage or index.html.

Make sure the file is served with the content type text/plain or text/markdown; most web servers do this automatically.

Then verify it’s live from your terminal:

curl https://yourdomain.com/llms.txt

You should see the full contents of your file printed back to the terminal. If you get a 404, double-check the filename (it’s llms.txt, not llm.txt) and the location (must be the web root).

A Complete Example

Here’s a full, copy-pasteable llm.txt file for a fictional SaaS company. Use it as a template and swap in your own values:

# Acme Analytics

> Acme Analytics is a privacy-first web analytics tool for small business 
> owners who want to understand visitor behavior without cookies or tracking scripts.

## Docs

- [Getting Started](https://acme.example.com/docs/start): 5-minute quickstart guide
- [Installation](https://acme.example.com/docs/install): How to add the tracking snippet
- [Dashboard Tour](https://acme.example.com/docs/dashboard): Every metric explained

## API

- [API Reference](https://acme.example.com/api): Complete endpoint documentation
- [Authentication](https://acme.example.com/api/auth): API key setup and rate limits
- [Webhooks](https://acme.example.com/api/webhooks): Real-time event delivery

## Blog

- [How We Stay Cookieless](https://acme.example.com/blog/cookieless): Our approach
- [Privacy Policy Explained](https://acme.example.com/blog/privacy): In plain English

## Optional

- [Changelog](https://acme.example.com/changelog): Product release history
- [About](https://acme.example.com/about): Company background

That’s a complete, spec-compliant llm.txt file in under forty lines.

Code editor with file tree and syntax-highlighted code, illustrating how an llm.txt file looks when opened in a real development environment

3 Common Mistakes to Avoid

Wrong filename. The specification says llms.txt, plural, with an s. Every month people publish a file at /llm.txt and wonder why agents can’t find it. Check yours now.

HTML instead of Markdown. llm.txt is Markdown, not HTML. Don’t wrap your summary in <p> tags or your links in <a> tags. Stick to standard Markdown syntax end to end.

Listing every URL on your site. A sitemap.xml is an exhaustive list of every page; your llm.txt is a curated shortlist of the pages that matter. If your file has more than thirty or forty entries, you’re reducing signal, not increasing it.

Next Step

That’s it. Your llm.txt file is live and AI agents visiting your site now have a structured map of your most important content.

For the deeper background on why this matters and how the specification came about, go back to the llm.txt explainer. With the technical floor in place, the next question is whether engines actually cite the pages they can now find. The walkthrough on ranking your content in ChatGPT and Perplexity covers the passage-level and evidence work that turns discoverability into citation share. And if you want to publish clean Markdown versions of the pages linked from your llm.txt, CopyMarkdown is the fastest way to do it. Your llm.txt also pairs naturally with RAG pipelines, where clean, structured content is essential. See our guide on preparing web content for RAG for the full picture.