Glossary
What is HTML to markdown conversion?
HTML to markdown conversion turns a webpage's markup into plain text that keeps headings, lists, links and tables, and drops tags, scripts and layout.
Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)
HTML to markdown conversion transforms a webpage's markup into markdown, a lightweight plain-text format that keeps headings, lists, links, tables and code blocks while discarding tags, scripts, styles and layout. It is a standard way to prepare web content for language models, because markdown keeps the document's structure at a much lower token cost than HTML.
Why convert HTML at all
HTML describes how a page renders, not just what it says. Tags, attributes, inline styles, scripts and layout scaffolding can outweigh the visible text many times over. A language model given raw HTML spends much of its context window on markup and page furniture. A model given markdown gets the same document in a form that is far smaller and easier to reason over.
Markdown became the target format for a practical reason: it is common in the text that models learn from, such as READMEs, forums and documentation, so models handle its conventions well: # headings, - lists, link syntax, fenced code blocks. It sits in a useful middle that plain text misses. Structure survives and noise does not.
What good conversion involves
Translating tags to syntax one by one is not enough. A useful converter does two separate jobs:
- Content selection. Identify the main content and drop navigation, ads, cookie banners, sidebars and footers. This "readability" step matters more than the syntax translation. Converting boilerplate to markdown just gives you tidy boilerplate.
- Faithful translation. Map headings to
#levels, keep link targets, keep tables as markdown tables, and fence code blocks with their language. Losing structure here hurts everything that comes after.
Hard cases include pages rendered by JavaScript (there is nothing to convert until a browser runs the page), complex nested tables, and pages where the boundary of the main content is unclear.
Where it fits in AI pipelines
HTML to markdown is a routine preprocessing step in web-connected AI systems. RAG pipelines convert pages to markdown before chunking and indexing them, agents that browse convert each page before reading it, and dataset builders convert whole corpora. It is the most common concrete form of LLM-ready data, and when you need fields instead of prose, its sibling is structured data extraction.
You can run the conversion yourself with open-source libraries, or use a hosted service that does it for a URL you send.
Where MillionShort fits
MillionShort search does not return HTML or markdown. Each result carries a snippet: a plain-text passage of up to 2,000 characters (800 by default), already free of markup, which you can place in a prompt as it is. With include_content, web and news results also carry the text of the page as we hold it, as plain text.
For a URL you send, Extract is the hosted converter: it fetches the page and returns its main content as Markdown or plain text.