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.txtJSON-LD
FormatMarkdown fileJSON inside a <script> tag
ScopeThe whole siteThe page it is embedded in
VocabularyFree text, headingsSchema.org types and properties
Answers“Which pages matter?”“What exactly is on this page?”
Main consumersAI agents and assistantsSearch engines, shopping and knowledge tools
Standards statusOpen proposal (llmstxt.org)W3C recommendation, years of tooling
MaintenanceRegenerate when the site changesKeep 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

FAQ

Can JSON-LD replace a llms.txt file?
No. JSON-LD describes individual pages; it cannot tell an agent which pages of your site matter most or where to start. A llms.txt file is the sitewide index that JSON-LD has no equivalent for.
Do AI models actually parse JSON-LD?
Model providers have documented using structured data in retrieval and grounding pipelines, and search engines parse it extensively. But an agent landing on your site blind will not discover per-page JSON-LD without crawling — which is the gap llms.txt closes.
Should the llms.txt file reference pages that have JSON-LD?
Indirectly, yes — the pages most worth listing in llms.txt are usually the same ones that deserve structured data: product pages, pricing, documentation. The two signals reinforce each other.
Which is faster to implement?
A llms.txt file: it is a single static file with no templating changes. JSON-LD typically means touching page templates or using a plugin per content type.
Is JSON-LD only for Google rich results?
Rich results are the most visible payoff, but the vocabulary is consumed by many tools: search engines, shopping aggregators, knowledge-graph builders and increasingly AI retrieval systems.

Related: llms.txt vs Schema.org ·llms.txt vs robots.txt ·llms.txt vs MCP