Why is Markdown the format AI prefers?
Why Markdown is the format AI prefers: structure without clutter
Markdown is the format AI prefers mainly because of what it leaves out. A typical web page in HTML contains far more than its article. There is navigation, cookie banners, footers, tracking scripts, styling and advertising. The llms.txt proposal points out that converting pages full of navigation, ads and JavaScript into clean text is difficult and imprecise.
Markdown avoids that problem. It is a plain text format in which a heading is a line starting with `#`, a list item starts with `-`, and a link is written as `text`. The structure is still there, but nothing else is.
```markdown
Opening hours
- Monday to Friday: 9am to 5pm
- Saturday: 10am to 2pm
Contact us ```
Why language models handle it well
The llms.txt proposal chose Markdown because it describes it as the format most widely and easily understood by language models. Several practical reasons support that:
- It is readable as plain text. RFC 7763, which registers the `text/markdown` media type, describes Markdown as designed to look like ordinary plain text writing that can optionally be converted to HTML.
- It is compact. The llms.txt proposal notes that context windows are still too small for most whole websites. Removing markup leaves more room for content.
- It is widely standardised. CommonMark provides a precise specification and test suite, so different tools read the same file the same way.
How AI services are using it
Cloudflare's Markdown for Agents feature, for sites on its network, converts HTML pages to Markdown when a client asks for `text/markdown` in its `Accept` header. Cloudflare describes Markdown as the common language of agents and AI systems. The converted output removes navigation, headers, footers, scripts and styles, adds the title and description as frontmatter, and keeps any JSON-LD structured data in a code block.
The llms.txt proposal also suggests publishing a clean Markdown copy of important pages at the same URL with `.md` added, so agents can fetch it directly.
What this means for your site
- Keep your HTML well structured, with real headings and lists, because that is what any conversion starts from.
- If you publish Markdown versions, keep them identical in content to the HTML pages.
- Use standard CommonMark syntax rather than tool-specific extras.
- Remember that Google Search uses your HTML and does not need Markdown files or llms.txt.
Common mistakes to avoid
- Publishing a Markdown copy that differs from the HTML page, which can confuse readers and tools that compare them.
- Leaving out headings, so the Markdown becomes one long block of text with no structure for a model to follow.
- Converting tables or code badly, so values or commands are lost. Check the output before publishing.
- Forgetting to update the Markdown version when the HTML page changes.
Create Markdown from your pages
The Markdown Generator from AI Web Page SEO turns a web page into clean Markdown, keeping headings, lists and links. Its Stripped mode removes the menu and footer, Full keeps the whole page and Custom lets you choose what is removed, so you can publish a Markdown version alongside the HTML.
Sources
- The /llms.txt file
- Markdown for Agents, Cloudflare docs
- CommonMark
- RFC 7763: The text/markdown Media Type
Frequently asked questions
If Markdown is the format AI prefers, does Google need a Markdown version of my pages?
No. Google Search crawls and indexes normal HTML, and Google has said no special AI files are needed to appear in AI Overviews or AI Mode. Markdown versions are aimed at other AI tools and agents that fetch pages on request. If you offer them, keep the content identical to the HTML page so both versions say the same thing.
Which Markdown flavour should I use?
Use CommonMark, or a widely used extension of it, so your files are read the same way by different tools. CommonMark exists because the original Markdown description was ambiguous and implementations drifted apart. Sticking to standard headings, lists, links and fenced code blocks avoids features that only one tool understands and keeps the file predictable for any reader.