llms.txt vs JSON-LD
A sitewide reading list versus embedded facts about a single page.
Short answer: they solve different problems and the strongest setups use both. JSON-LD is a machine-readable data format embedded in one page, describing its facts (a price, a date, an author) with the Schema.org vocabulary. A llms.txt file is a human-readable index of your whole site, telling an AI which pages deserve attention and in what order. One annotates pages; the other curates the site.
What JSON-LD is
JSON-LD (JSON for Linked Data) is a W3C-recommended way to express structured data as JSON. On the web it almost always appears as a <script type="application/ld+json">block inside a page, describing that page’s subject using theSchema.org vocabulary:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Acme Pro",
"offers": {
"@type": "Offer",
"price": "29.00",
"priceCurrency": "USD"
}
}
</script>The block travels with the page. A search engine parsing it knows the exact price without guessing from layout; an AI extracting facts gets typed, unambiguous data. Its scope, though, never extends past the page it lives on.
What a llms.txt file is
llms.txt is a single markdown file at your site root. It contains no per-page data at all — just a summary of the site and a curated list of links, grouped under headings:
# Acme
> Invoicing software for independent developers.
## Docs
- [API reference](https://acme.com/docs/api): REST endpoints and auth.
- [Pricing](https://acme.com/pricing): Three tiers, free plan included.Where JSON-LD says “here are the facts of this page”, llms.txt says“here are the ten pages of this site worth your context window”. It is a navigation and curation layer, not a data layer.
Side-by-side comparison
| llms.txt | JSON-LD | |
|---|---|---|
| Format | Markdown file | JSON inside a <script> tag |
| Scope | The whole site | The page it is embedded in |
| Vocabulary | Free text, headings | Schema.org types and properties |
| Answers | “Which pages matter?” | “What exactly is on this page?” |
| Main consumers | AI agents and assistants | Search engines, shopping and knowledge tools |
| Standards status | Open proposal (llmstxt.org) | W3C recommendation, years of tooling |
| Maintenance | Regenerate when the site changes | Keep templates emitting valid data |
When to use which
Use JSON-LD when the facts matter per page. Product prices, event dates, recipe steps, article metadata — anything a machine should extract exactly. This is the obvious choice for e-commerce and content sites whose traffic arrives through search.
Use llms.txt when orientation matters. Documentation sites, developer tools and products with deep sites benefit most: an agent that lands on your homepage has no way to know that /docs/api matters and /blog/tag/rust does not. The file gives it that map in one request.
Doing both is normal. The llms.txt file lists the page; the page’s JSON-LD gives the precise facts once the agent arrives. They compose cleanly because they never describe the same layer.
What JSON-LD does better — honestly
JSON-LD has institutional weight llms.txt lacks: it is a W3C recommendation with search-engine consumption proven over a decade, and implementing it has a direct, measurable payoff in rich results. llms.txt is a young proposal, and no AI client has publicly committed to reading it the way Google commits to parsing structured data. If your only goal is search visibility, JSON-LD is the safer investment today; llms.txt is a cheap hedge on agentic traffic. For the vocabulary-level view rather than the format, seellms.txt vs Schema.org.
Common mistakes
- Copying a site’s entire navigation into JSON-LD — it describes entities, not menus.
- Expecting llms.txt to carry structured facts; keep prices and dates in per-page data.
- Duplicating every page’s content into llms.txt — that is whatllms-full.txt is for, used sparingly.
FAQ
Can JSON-LD replace a llms.txt file?
Do AI models actually parse JSON-LD?
Should the llms.txt file reference pages that have JSON-LD?
Which is faster to implement?
Is JSON-LD only for Google rich results?
Related: llms.txt vs Schema.org ·llms.txt vs robots.txt ·llms.txt vs MCP