HTML to Markdown

What is an Html To Markdown?

Markdown is the writing format of README files, documentation sites, static site generators, wikis and many CMSs. When migrating content from a web page, a WYSIWYG editor or an old CMS, converting HTML by hand is tedious. This tool converts HTML to clean Markdown using Turndown, a widely used conversion library.

How to use it

  1. Paste the HTML.
  2. Copy the Markdown output.

Example

Input:

<h2>Install</h2>
<p>Run the <strong>installer</strong>, then see <a href='https://example.com/docs'>the docs</a>.</p>
<ul><li>Fast</li><li>Free</li></ul>

Output:

## Install

Run the **installer**, then see [the docs](https://example.com/docs).

*   Fast
*   Free

What converts

  • Headings, paragraphs, bold and italic.
  • Links and images, with alt text.
  • Ordered and unordered lists, including nesting.
  • Code blocks and inline code.
  • Blockquotes and horizontal rules.

Limitations

  • Tables need the GitHub Flavored Markdown extension; without it they may become plain text.
  • Styling such as colours, fonts and layout has no Markdown equivalent and is dropped.
  • Complex layouts built with divs become simple paragraphs.
  • Elements with no Markdown equivalent may be kept as raw HTML, which most Markdown renderers accept.

Tip

Clean the HTML first by removing navigation, ads and scripts. Converting only the article content gives much tidier Markdown.

Frequently Asked Questions

What library does the converter use?

Turndown, a popular JavaScript library for converting HTML to Markdown.

Are HTML tables converted?

Simple tables can be converted with GitHub Flavored Markdown support. Complex tables may need manual cleanup.

What happens to CSS styling?

It is dropped, because Markdown only represents structure and basic emphasis.

Can I convert a whole web page?

Yes, but you will get cleaner results if you paste only the main content without navigation and footers.

Which Markdown flavour is produced?

Standard CommonMark-style Markdown, which works on GitHub, GitLab, most static site generators and documentation tools.