HTML to Markdown converter
Turn HTML into clean Markdown, keeping the structure.
1 · Input
2 · Output
Headings, lists, links, tables, blockquotes and code are preserved. Script and style blocks are dropped with their contents, and a javascript: or data: link is not carried through - Markdown renderers would turn it back into a live link.
What it keeps
Headings, bold and italic, links, images, ordered and unordered lists including nested ones, blockquotes, inline code, preformatted blocks, horizontal rules and tables. Structure is what makes the difference between Markdown and a wall of text, so structure is what it preserves.
What it removes on purpose
Script and style blocks go entirely, contents and all. So does a link with a javascript: or data: destination: Markdown renderers turn those back into live links, so carrying one through would make this tool a laundering step for something that should not survive.
Escaping
Markdown gives meaning to asterisks, underscores, backticks, brackets and several other characters. Prose containing them is escaped so it survives as prose rather than silently becoming formatting. A backtick inside inline code is handled by fencing it with a longer run, which is how Markdown itself solves that.
How it parses
It uses the browser's own HTML parser in inert mode, so nothing in the input executes and no image, stylesheet or iframe is fetched while converting. A converter built on regular expressions cannot understand nesting, and one built on innerHTML runs whatever it was given.
Example
<h2>Title</h2><p><strong>bold</strong> text</p> becomes ## Title followed by **bold** text.
Limitations
Markdown has no equivalent for many HTML constructs. Definition lists, nested tables, colspans, form controls and arbitrary attributes have no representation and are flattened to their text. Complex page layouts convert to readable prose, not to a faithful copy.
Related tools
See remove HTML tags when you want text with no formatting at all, and the rich text HTML editor.
Rate this tool
Was this tool useful? Your feedback helps us improve it.