What Is llms.txt, and Should Your Site Have One?
llms.txt is a Markdown map of your site for AI tools. What goes in it, who actually reads it, whether it helps SEO, and how to generate one in Next.js.
robots.txt tells crawlers where they may go. sitemap.xml lists every page. llms.txt is a newer, much smaller idea: a short Markdown file at the root of your site that tells AI assistants what the site is and which pages matter most.
It has spread quickly through developer documentation, and it's surrounded by hype about "ranking in ChatGPT". This guide explains what the file is, what it can and can't do for you today, and how to add one in a few minutes, including a version for Next.js that writes itself from your content.
Where it came from
Jeremy Howard, co-founder of Answer.AI, proposed llms.txt on 3 September 2024. The problem it targets is real: web pages are built for people, with navigation, scripts, cookie banners and layout around the content. An AI model working within a limited context window wastes much of it on that clutter, and has no easy way to tell which of a site's thousand pages are the important ones.
The proposal: put a plain Markdown summary at /llms.txt, written for language models, with links to the pages worth reading.
The format
An llms.txt file is Markdown with a light structure, in this order:
- An H1 with the name of the site or project. It's the only required part.
- A blockquote with a one- or two-sentence summary.
- Optional notes: paragraphs or lists with anything a reader needs to know first.
- H2 sections of links, each link written as
- [Name](URL): optional description. - An
## Optionalsection, if you like, for links a reader can skip when short on space.
Here's a small example for a fictional library:
# Tinyflow
> Tinyflow is an open-source TypeScript library for building small, typed
> workflow engines that run in the browser or on Node.js.
Tinyflow has no runtime dependencies. Version 3 is current; version 2 is no
longer maintained.
## Docs
- [Getting started](https://tinyflow.dev/docs/start.md): install, first workflow, running it
- [API reference](https://tinyflow.dev/docs/api.md): every exported function and type
- [Migrating from v2](https://tinyflow.dev/docs/migrate.md): breaking changes and how to update
## Examples
- [Approval flow](https://tinyflow.dev/examples/approval.md): a multi-step approval with timeouts
## Optional
- [Changelog](https://tinyflow.dev/changelog.md)
- [Design notes](https://tinyflow.dev/docs/design.md): why Tinyflow works the way it does
You can draft and preview yours in the Markdown editor before publishing it.
Two related conventions
.mdversions of pages. The proposal also suggests offering a clean Markdown copy of important pages at the same URL with.mdadded, which is why the links above end in.md. It's optional; plain page URLs work too.llms-full.txt. Some documentation platforms also publish a single file with the full text of every page. It isn't part of the original proposal, but it's common on developer docs, where people paste the whole thing into an AI tool.
Who actually reads it?
This is where the hype and the reality part ways.
- Google says its search doesn't use it. Google's John Mueller wrote in 2025 that "no AI system currently uses llms.txt", and compared it to the old keywords meta tag. Google's Gary Illyes has said that normal SEO is what gets you into AI Overviews. Adding the file won't change your Google rankings.
- No major AI search engine has officially committed to it either, as far as public statements go.
- Developers and AI agents do use it. Its real home is documentation. Many developer docs publish one, and it's a handy thing to point a coding agent at, or paste into a chat, when you want the AI to understand a library's structure before it writes code against it.
So llms.txt is best seen as a clean, cheap summary for anyone (person or program) who wants your site in Markdown, not as an SEO lever.
Should your site have one?
| Your site | Worth it? |
|---|---|
| Developer documentation, an API or a library | Yes. It's where the file is genuinely used |
| A portfolio, blog or tool site | Nice to have. Cheap if it's generated automatically |
| A shop or local business | Low priority. Get the basics right first |
The basics that actually affect how search and AI answer engines see you are the same as ever:
- Clear titles and descriptions, written for people.
- Structured data (schema.org JSON-LD) describing what each page is.
- A sitemap and sensible internal links.
- Plain answers on the page, such as a short FAQ, which answer engines can quote.
- Fast, accessible pages that work without JavaScript where possible.
How to add one
The simple way: a static file
Write llms.txt and put it where your site serves files from its root: public/ in Next.js, Vite and most static site generators. It will be served at https://your-site.com/llms.txt.
The downside is that it goes stale the moment you add a page and forget to update it.
The better way: generate it
If your content lives in files or a CMS, generate the file at build time from the same data as your pages. In the Next.js App Router, a route handler at app/llms.txt/route.ts does it:
import { getPosts, getSite } from '@/lib/content';
// rendered once at build time, like a static file
export const dynamic = 'force-static';
const link = (name: string, url: string, note?: string) => `- [${name}](${url})${note ? `: ${note}` : ''}`;
export async function GET() {
const [site, posts] = await Promise.all([getSite(), getPosts()]);
const text = `# ${site.name}
> ${site.description}
## Writing
${posts.map((post) => link(post.title, `${site.url}/blog/${post.slug}`, post.excerpt)).join('\n')}
`;
return new Response(text, { headers: { 'Content-Type': 'text/markdown; charset=utf-8' } });
}
force-static makes Next.js render it once at build time, so it costs nothing per request, and it updates itself whenever you publish.
This site does exactly that: me.djiavu.space/llms.txt lists the CV, projects, every post and every tool in the toolkit, built from the same JSON as the pages.
Tips for a good one
- Keep it short. It's a map, not a copy of the site. A few dozen links is plenty.
- Use absolute URLs, since the file is often read away from your site.
- Write descriptions that help choose: "breaking changes and how to update" tells a reader whether to open the link; "migration guide" barely does.
- Put the essentials first and the nice-to-haves under
## Optional. - Leave out anything private. It's public, like the rest of the site.
Summary
llms.txtis a Markdown file at your site's root that summarises the site for AI tools and links to its key pages.- Its format is an H1, a blockquote summary, optional notes and H2 sections of links, with an optional
## Optionalsection. - Google says it doesn't use it, so it's not an SEO lever. Its real value is for documentation and AI agents.
- If you add one, generate it from your content so it never goes stale.
For the bigger picture of how AI tools read text and why clean Markdown helps, see AI tokens explained.