Skip to content

Markdown vs HTML for AI: I Publish Both. Here Is What Actually Gets Read

Markdown vs HTML for AI, tested in production. My markdown pages are 20x lighter, yet AI search engines cite only HTML. Here is what to serve, and where.

Sunny Kumar
Sunny Kumar7 min read
TL;DR

Markdown is the leaner format for AI by a mile: the markdown twin of a typical page on this site is about 20 times smaller than its HTML, roughly 6,200 tokens instead of 118,000. But controlled tests show AI search engines almost never fetch or cite .md pages. Serve markdown as free infrastructure for agents, and keep your visible HTML as the page that earns citations.

Every page on this site is published twice. The version you are reading is HTML. The other is a plain markdown file at this same address with .md added to the end, built for AI crawlers and agents.

So when the markdown vs HTML for AI argument comes up, I do not have to guess. I run both formats in production, and I checked the actual numbers before writing this.

Here is the honest split: markdown wins on weight by a factor of about 20, and it still earns you nothing in AI search on its own. Both halves of that sentence matter.

Markdown vs HTML: what is the actual difference?

Markdown is plain text with a few symbols: # for headings, * for lists, pipes for tables. HTML is the full language of web pages: tags, attributes, scripts, styles, metadata. The same article can exist in both; the difference is how much machinery wraps the words.

MarkdownHTML
Built forPeople and language modelsBrowsers
CarriesHeadings, lists, links, tablesAll of that, plus scripts, styles, schema, meta tags
WeightTinyHeavy

The reason AI people care about the html vs markdown debate is simple: language models are soaked in markdown. Microsoft maintains MarkItDown, a converter with over 170,000 GitHub stars whose whole job is turning PDFs, Word files and HTML into markdown, because as its README puts it, mainstream LLMs natively "speak" markdown. Jina Reader does the same for any URL before an LLM reads it.

Notice the direction of every one of those tools. The industry converts to markdown at the point of reading. That part of the argument is settled.

How much smaller is markdown than HTML? My real numbers

I pulled three of my own posts twice each, once as the HTML page and once as the markdown twin, straight off the live server.

PostHTMLMarkdown twinDifference
llms.txt guide473 KB25 KB19x
ChatGPT SEO case study458 KB22 KB21x
Entity SEO guide453 KB19 KB23x

By the rough four-characters-per-token rule, that first post is about 118,000 tokens as raw HTML and about 6,200 as markdown. Same words, same tables, same links.

A model that eats the raw HTML pays a 20x token tax for content it did not ask for: navigation, scripts, styles, JSON-LD, hydration payloads.

One honest nuance before you rebuild your site over this. Serious AI pipelines do not feed raw HTML to the model; they run extractors that strip the noise first. So the real question is not whether markdown is lighter. It is whether serving markdown changes what AI systems actually do.

Do AI crawlers actually fetch markdown pages?

Mostly no. This is where the popular advice falls apart, and I am saying that as someone who serves markdown on every page.

Otterly ran the clean version of the experiment: .md copies of live pages published beside the HTML, equal discoverability, 14 days of watching. The .md URLs got zero AI crawler visits and zero citations. Every citation the test pages earned went to the HTML version.

Profound ran a bigger one across 381 pages on six websites for 21 days. The markdown group earned roughly one extra median bot visit over three weeks, and the difference was not statistically significant. Their own conclusion: no slam dunk.

A third test from SEO Depths served markdown directly to OpenAI's bots and measured delivery: content download dropped to about 40ms from 169ms, and the author still landed on the same verdict. The win is control and cleaner output, not rankings.

AI search engines read your HTML and clean it themselves. They do not go looking for a markdown menu.

Why do I still serve markdown twins, then?

Because search crawlers are not the only machines reading the web now. Agents are the other audience, and they behave differently.

When a person points a coding agent or an AI assistant at your site, that agent can fetch the .md twin and get the whole article inside a context budget where the raw page would not fit. A 6,200-token file is a polite guest; a 118,000-token one is not. This is the same logic behind llms.txt, which AI search engines also do not read, and which I generate anyway for exactly this audience.

The raw markdown twin of a TheGuideX post shown in a browser, with the title, source URL, published date, author byline and TL;DR as plain markdown text
What an agent gets from the .md twin: the whole article as plain markdown. Title, source, dates, byline, TL;DR, and not one line of page furniture.

The other reason is cost. My twins are generated at build time from the same source files as the pages. Zero extra writing, zero maintenance, no way for the two versions to drift apart.

And the structure survives. Headings, tables and links, the things engines actually quote, arrive clean instead of after a lossy extraction.

How do you serve markdown for AI crawlers properly?

If you do it, do it this way. Each of these choices got tested on this site, one of them painfully.

  1. Give the twin its own URL. /insights/post gets a sibling at /insights/post.md. Generate it at build time from the same source.
  2. Advertise it in the head: <link rel="alternate" type="text/markdown" href="/insights/post.md">, plus an HTTP Link header if you can.
  3. Noindex the twin. Serve it with X-Robots-Tag: noindex so Google never treats it as a duplicate of the real page.
  4. Unfold your components. If your pages use shortcodes or MDX blocks, the twin must render them out to plain markdown. Stripping them blindly deletes the most quotable parts of the page.
  5. Do not content-negotiate. I first served markdown from the page's own URL when a client sent Accept: text/markdown. Cloudflare normalised that header away before it reached my origin, so the feature was silently dead. Worse, with edge caching on, one markdown response landing in the cache could have served raw markdown to every browser on that URL. Separate .md URLs, no negotiation.

You can check a working setup in one line:

bash
curl -sI https://theguidex.com/insights/llms-txt.md
# content-type: text/markdown; charset=utf-8
# x-robots-tag: noindex
# x-markdown-tokens: 6202

That last header is a build-time token estimate stamped on every twin, so an agent can budget its context before it commits to the fetch.

Does markdown replace HTML for SEO?

No, and do not let anyone talk you into trying.

Your HTML page is where the canonical URL, the Open Graph tags, the schema, the byline and the internal links live. Those are the signals engines use to work out what a page is and whether to trust it, and a bare .md file carries none of them. Otterly's test pages showed the result: engines cited the HTML precisely because it is the version wired into the web.

The visible HTML body is also what gets extracted, chunked and quoted in AI answers. If you want the citation, the work is making your visible content worth quoting, and letting the right bots in, which is a robots.txt job, not a file-format job.

Markdown is a copy for machines that already found you. HTML is how you get found.

Want AI engines to actually cite you?

The format debate is a sideshow. We build the entity clarity, extractable content and third-party mentions that decide whose name AI answers use. That is our GEO and AEO service.

See the GEO / AEO service

Final take

Markdown vs HTML for AI is a false fight. They are not competing for the same job.

HTML is the page: indexed, ranked, extracted, cited. Markdown is the takeaway copy: light, clean, and read by agents that a human pointed at you. On this site the twin costs nothing to produce, so I serve it and expect nothing from it in search.

If your build can generate markdown twins for free, do it. If someone is selling markdown as an AI search tactic, ask them for the citation data. I looked, and it only ever points one way.

Common questions

Do AI crawlers prefer markdown or HTML?

They fetch HTML. A 14-day controlled test found AI search platforms gave .md pages zero visits and zero citations while citing the HTML versions, and a 381-page experiment found no statistically significant traffic lift from markdown. Engines extract clean text from your HTML themselves.

Should I convert my website to markdown for AI?

No. Your HTML page carries the canonical URL, schema, Open Graph tags and internal links that engines use to judge and cite you. If you want to serve markdown, publish it alongside the HTML at its own .md URL, generated automatically at build time.

How much smaller is markdown than HTML?

On this site, about 19 to 23 times by bytes. One post is 473 KB as HTML and 25 KB as its markdown twin, roughly 118,000 estimated tokens against 6,200. The words are identical; the difference is scripts, styles, navigation and metadata.

Do ChatGPT and Perplexity read .md files?

Not as search crawlers. Controlled tests show their bots ignore parallel .md URLs when picking citation sources. Where .md files do get read is agents and assistants, such as coding tools a person points at your site, which is a different and smaller audience.

Is markdown better for SEO than HTML?

No. Google indexes and ranks your HTML. A markdown twin should be served with a noindex header so it never competes with the real page as duplicate content. Markdown serves machines that already found you; it does not help you get found.

What is a markdown twin (.md twin)?

A plain markdown copy of a page published beside it at the same path with .md added, like /insights/post.md. It is advertised with a link rel alternate tag, served as text/markdown, noindexed, and rebuilt automatically whenever the page changes.

Written by
Sunny Kumar
Sunny KumarSEO Specialist & product builder

SEO Specialist and product builder with 10+ years in search. The notes come from the work, not the theory.

Work with TheGuideX

Reading about it is the easy part.

Send us the site and the problem. Your first reply comes from Sunny Kumar — not a sales team — and tells you if it is a fit.