HTML to Markdown
Convert complex HTML structures into clean, lightweight Markdown syntax
Move content from web markup into plain-text Markdown
Markdown is easier to write, review in version control and keep in a README or static site than raw HTML. When you already have the HTML, say a blog snippet, a help article or an email template, retyping it is tedious. This converter walks through the markup and rewrites the common elements into their Markdown equivalents.
Converting a snippet
- Paste your markup into the HTML Input editor, which has line numbers, or use Paste to bring it in from the clipboard. Load Sample fills in a heading, list, quote and link and converts it right away.
- Click Convert to Markdown.
- Review the Markdown Output panel. The header shows a character count for the result.
- Press Copy, or Download to save the text as converted.md. Clear empties the editor.
Which elements are converted
- Headings h1, h2 and h3 become lines starting with #, ## and ###.
- b and strong become double asterisks; i and em become single asterisks.
- Paragraphs are separated by blank lines, and br becomes a line ending with two spaces.
- Links turn into [text](url), with # used when an anchor has no href.
- Inline code is wrapped in backticks, and blockquotes get a leading > marker.
- List items become lines starting with an asterisk.
Where it is handy
- Porting old blog posts from a CMS into a Markdown-based static site generator.
- Turning documentation copied from a web page into a README section.
- Cleaning a formatted snippet so it can go into a chat tool or issue tracker that renders Markdown.
- Extracting readable text from an HTML email while keeping links and emphasis.
What to expect from the output
This is a compact converter, not a full parser. Elements it does not know, such as tables, images, pre blocks, h4 to h6 headings, div and span, are stripped of their tags and only their inner text is kept. Ordered lists come out as bullet lists because every list item uses an asterisk, and nested lists are not indented. Review the result and patch those parts by hand. The markup is parsed by your browser rather than sent anywhere, so paste only HTML you trust. Whitespace between tags is retained, so tidy the blank lines afterwards if the source was heavily indented.
Related Tools