Markdown Parity: Serving Your Pages to AI Agents

Markdown Parity: Serving Your Pages to AI Agents

The same page, one more representation. Build-time .md siblings, Accept negotiation, or edge conversion — generated from one source, never hand-maintained.

Agents pay for your template chrome in tokens, and some popular coding agents (Cloudflare names Claude Code and OpenCode) already ask for markdown instead. Markdown parity means serving a faithful markdown representation of the same page — via build-time sibling files, HTTP content negotiation, or edge conversion. This guide covers the three delivery routes, the caching trap that bites the negotiation route, and the one rule that keeps the surface honest: generate it from the same source, never hand-maintain it.

Why agents ask for markdown

An HTML page is built for a browser. Around the content sit navigation, cookie banners, script tags, tracking snippets, and the div scaffolding of whatever framework rendered it. A human never sees that overhead; a browser spends milliseconds on it. An agent pays for it directly: every byte of chrome is tokens in a context window, and every layer of markup is structure to parse around before the actual content appears. A markdown rendering of the same page is a fraction of the size, and its structure is unambiguous — headings are headings, tables are tables, code arrives fenced.

The plumbing for this is not new. The text/markdown media type has been registered since RFC 7763, published in 2016 — long before websites were described as "agent-ready." What is new is the demand. Cloudflare's launch note for its Markdown for Agents feature (February 2026) reports that some of the most popular coding agents, such as Claude Code and OpenCode, already send Accept headers requesting markdown with their requests for content. The same note made markdown conversion at Cloudflare's edge available in beta, at no cost for Pro, Business and Enterprise plans and for SSL for SaaS customers; Cloudflare's documentation still labels the feature beta as of Nov 2026. At least one documentation platform has gone the same way: Read the Docs serves markdown versions of documentation pages, using HTTP content negotiation, for exactly this audience (as of Nov 2026).

Two boundary sentences keep this article precise. Markdown parity is not the llms.txt file — that file is a discovery index, a different mechanism owned by a different discipline — although the same llms.txt proposal also suggests that pages with information agents might need offer a clean markdown version at the page's URL with .md appended or with the extension replaced by .md, the same shape as the build-time sibling route below. And parity assumes the content is reachable in the first place: what an agent's scriptless fetch receives is its own audit, covered elsewhere on this topic. Parity is one thing only: the same URL's content, one more representation. That framing also names the failure mode this whole guide designs against — a markdown surface that says something different from the HTML it mirrors.

Three delivery routes

There are three places to produce the markdown representation, and the right one follows from your stack.

RouteHow it worksBest forThe catch
Build-time siblingsGenerate a .md file per page at build, served at a predictable URLStatic sites, docs, content sites with buildsAnother build artifact to keep in scope
Content negotiationHonor Accept: text/markdown at the same URLTeams that control their server/framework layerCaching must vary correctly or browsers get markdown
Edge conversionA CDN that offers it transforms HTML to markdown on requestFastest adoption, no origin code changesLeast control over output fidelity

Build-time siblings are the simplest honest implementation. If your pages come from a build — a static site generator, a documentation toolchain, a framework with static export — emit a markdown file next to each HTML page and serve it at a sibling URL. There is no runtime logic to break, it works on any host that can serve static files, and the artifact is inspectable in the repository.

Content negotiation is the cleanest contract: one URL, multiple representations, selected by the standard Accept mechanism, a long-standing part of HTTP semantics (now defined in RFC 9110, Section 12.5.1; see also MDN's content negotiation reference). A request that prefers text/markdown gets markdown; a browser gets HTML:

http
GET /services/web-development HTTP/1.1
Host: example.com
Accept: text/markdown

HTTP/1.1 200 OK
Content-Type: text/markdown; charset=utf-8
Vary: Accept

The catch is that Vary: Accept header. HTTP semantics say an origin server SHOULD generate a Vary header field on a cacheable response when it wishes that response to be selectively reused for subsequent requests, and that Vary might be elided when the origin server considers variance in content selection less significant than Vary's performance impact on caching, particularly when reuse is already limited by cache response directives (RFC 9110, Section 12.5.5). For a cacheable markdown representation served by negotiation at the same URL, this guide treats Vary: Accept as required. Every cache between you and the visitor — CDN, proxy, browser — keys cached responses by URL. If the same URL returns two representations and the cache does not know the Accept header is part of the key, the first markdown response cached for a page will be served to the next browser that asks for it. A human staring at raw markdown where your homepage should be is the classic failure of this route, and it is entirely preventable: set Vary: Accept, confirm your CDN actually honors it in its cache key, and test both representations through the cache, not around it.

Edge conversion trades control for speed of adoption: a CDN that offers the feature converts your HTML to markdown when an agent asks, without changes to your origin code. Cloudflare's Markdown for Agents, for example, is a setting enabled through Cloudflare's dashboard or API for a zone or for specific subdomains or paths, is available in beta to Pro, Business and Enterprise plans and SSL for SaaS customers as of Nov 2026, and converts HTML to markdown when possible, up to a documented size limit on the decompressed HTML. It is the fastest route to shipping something, and the right choice when you cannot touch the origin. The honest cost is fidelity — a generic converter works from general rules rather than from knowledge of your templates (Cloudflare's documentation, for example, says non-content elements such as headers, footers, navigation, scripts and styles are stripped during pre-processing), so it may not tell which of your own components are content and which are chrome. Audit its output on your real templates before trusting it (capability specifics are the provider's documentation's to state; verify at adoption time).

What a faithful rendering contains

Whichever route produces it, the markdown representation has a job description.

Keep the things an agent quotes and reasons over: the heading hierarchy, tables, code blocks, image alt text, and publication dates. Include a link back to the canonical HTML URL, so the representation identifies its origin — an agent that cites you should have no trouble citing the right page. Strip the things agents came to avoid: navigation, banners, footers, decorative markup, and any widget that only means something with script behind it.

Then the one rule that outranks the rest: generate the markdown from the same source as the HTML, and never hand-maintain it. Parity produced from the content source — the CMS field, the MDX file, the rendered content region — survives template changes automatically. A hand-edited parallel copy starts faithful and drifts, silently, with every edit that touches one representation and not the other. There is no error for divergence; there is only an agent reading a stale price, an old policy, a deleted feature — and repeating it with confidence somewhere you will never see. If markdown parity earns one line in your architecture docs, it is this one.

Operationally, the surface is ordinary HTTP: stable URLs, Content-Type: text/markdown; charset=utf-8, cache keys that separate representations, and the same cache lifetimes you give the HTML.

Scoping and verification

Parity does not need to cover the whole site, and it should not start there. The pages worth serving in markdown are the ones agents quote and reason over: documentation, long-form articles, service and product explanations, policies. Transactional flows, dashboards, and interactive tools gain little from a markdown twin — an agent that needs to do something on your site is served by the capability layer of this topic, not by a flattened rendering of your UI.

Whether the surface is earning its keep is a question your own logs answer: the frequency of Accept: text/markdown requests and fetches of the sibling URLs, segmented by the agent identification this topic covers separately. And the surface belongs in CI like anything else you serve — parity regenerated on every content change, with a fidelity check that asserts the invariants (one H1, tables intact, no leaked template markup) before the merge lands; the testing article owns the full inventory.

One honesty note to close. Markdown parity makes your site cheap to read; it does not make anyone read it. Whether answer engines cite you is a different discipline with its own literature. What parity buys is narrower and real: when an agent does arrive, it gets your content — dense, structured, and saying exactly what the page says — instead of a thousand tokens of chrome around a truth it might miss. For a decade-old media type and a build step, that is a good trade.

Project Inquiry