Cloudflare Launches “Markdown for Agents”: Fewer Tokens, More Context, and a New Layer for AI Web Platforms

Cloudflare has introduced a simple idea with huge implications for anyone working with language models: serving a Markdown version of a webpage on demand, without modifying the site or maintaining “double” versions. The launch is called Markdown for Agents, and its promise can be summarized by a key figure: a webpage that, in HTML, could consume 16,180 tokens, would require only 3,150 tokens when delivered in Markdown—roughly an 80% reduction in the context “budget.”

This move comes at a time when traffic no longer relies solely on search engines and human users. Increasingly, AI tools and agents are crawling documentation, comparing information, or extracting content to answer questions, generate code, or automate tasks. In such an environment, HTML—designed to render interfaces—becomes a burden: menus, layers, styles, scripts, and templates occupy tokens… even if they add no meaning to the model.

How it works: content negotiation over HTTP and edge conversion

The mechanism leverages a classic Internet feature: HTTP header content negotiation. If the client (an agent, crawler, or programming tool) sends a request with:

and the domain has this feature enabled, Cloudflare fetches the original HTML from the server, converts it to Markdown on its network, and returns a “clean” document with content-type: text/markdown, along with Vary: accept to differentiate cache variants.

Cloudflare also notes that some encoding agents are already sending these headers by default, such as Claude Code and OpenCode, making this change almost automatic for parts of the ecosystem.

An especially relevant detail for “LLM folks”: the Markdown response can include a x-markdown-tokens header with an estimate of the document’s size in tokens. This helps decide whether it fits within the context window or if it should be split up.

Comparison table: HTML vs. Markdown for AI agents

AspectHTML (Web “for humans”)Markdown (Web “for agents”)Practical impact on LLMs/agents
Token sizeHigh: includes structure, styles, scripts, and “noise”Lower: minimal text and hierarchyMore useful content per window; lower query cost
Semantic readabilityDepends on markup quality (semantic vs. “divitis”)Depends on HTML conversionIf HTML is chaotic, Markdown may be too (no magic)
Content hierarchyExists but may be diluted by templatesHeadings, lists, and sections tend to be clearerBetter chunking and section retrieval in RAG and agents
Format negotiationNatively supported by browsersNatively supported for agents (via Accept)Allows serving the same content in different representations without changing URLs
Publisher controlDelivers raw HTMLOpt-in for an alternative representationPublishers decide whether to enable agent mode and how to integrate it
Signals for AI useNot necessarily explicitCan include Content-Signal by defaultRaises questions about governance over AI content usage
Support for dynamic contentComplete (client-side rendering)Limited if HTML doesn’t contain real contentFor SPAs, may be insufficient; Cloudflare suggests real-rendering alternatives
Risks of “dual reality”Lower: single formatHigher: variant for botsDebates about “cloaking” and verification arise

What this means for tech media: efficiency, traceability, and metrics

Beyond the savings, there are two key technical takeaways:

1) Observability of agent consumption. Cloudflare states that Radar now provides insights by content type served to bots and crawlers, with filters to see distribution by MIME type and detect Markdown requests from specific agents (including OAI-Searchbot example).
In a world where “audiences” are no longer only human, measuring what machines consume becomes a valuable business metric.

2) A standard rather than private heuristics. Previously, many agents converted HTML to text/Markdown with their own rules, causing inconsistent results. Now, conversion occurs “at the edge” of the network, creating a more uniform process. The tradeoff is clear: a layer of representation is delegated to an intermediary, and fidelity depends on how Cloudflare interprets the HTML.

Limitations (and why they matter in production)

Cloudflare specifies concrete limits in its documentation. For example, the system will not return Markdown if the origin response lacks content-length or exceeds 1 MB (1,048,576 bytes); in those cases, it returns the original HTML. Additionally, compressed responses from the origin are not supported, and currently, only HTML conversion is available.

For those working with large or heavy pages, this is an important consideration: headers, sizes, and cache behaviors must be carefully managed to ensure reliable conversion.

Regarding dynamic content, Cloudflare recommends alternative solutions like an endpoint for Browser Rendering, which converts to Markdown after rendering “in a real browser,” especially to address cases where static HTML doesn’t reflect what the end-user sees.

The inevitable debate: optimization for agents or a gateway to cloaking?

As expected, the launch has raised concerns in the SEO community. Some worry that, with a “machine-friendly” variant, sites might serve different content to agents. Search Engine Land highlights this risk as “AI cloaking” if the dual representations are abused.

Cloudflare’s approach aims to minimize this friction: it’s not a different URL, just header-based variants. But from an external system’s perspective, the challenge remains: if two representations exist, someone must decide which is the “real” one (or if they should be compared).

The takeaway: Markdown helps but doesn’t fix bad HTML

Markdown for Agents is a pragmatic improvement for the web content consumed by agents: fewer tokens, more usable content, and a standardized way to request it. Still, the ultimate quality depends on the same fundamentals: semantic, well-structured HTML. If the page is built as a tangled mess of containers and meaningless elements, conversion can do little to “rescue” it.

Practically, this release introduces a new discipline for tech and content teams: designing pages not just for humans and search engines, but for faithful translation into machine-friendly formats.


Frequently Asked Questions

How do you activate Markdown for Agents on a website?
Enable it at the Cloudflare zone level (“Markdown for Agents” option), and agents request it with Accept: text/markdown.

What real token savings can be expected when switching from HTML to Markdown?
It varies per page, but Cloudflare has shared examples of reductions close to 80%, such as going from 16,180 tokens (HTML) to 3,150 (Markdown).

What technical limitations does the conversion have?
It won’t convert if content-length is missing or if size exceeds 1 MB (1,048,576 bytes). It also doesn’t support compressed responses from the origin and currently only converts HTML.

Is serving Markdown to agents and HTML to humans considered “cloaking”?
The debate exists: it’s not a different URL, but a different representation via headers. Some SEO experts warn of potential misuse and emphasize the need for controls.

Scroll to Top