About the HTML to Markdown converter
Markdown is easier to read, edit and keep in version control than HTML. Converting HTML to Markdown is useful when you move content from a website or CMS into docs, a README, a static site generator or a notes app.
This converter turns headings, paragraphs, lists, links, images, quotes and code into Markdown, and with GitHub-flavored Markdown it also converts tables, strikethrough and task lists.
How to use the HTML to Markdown converter
- Paste HTML into the Input editor, or click Load sample. A full page works too; its body is converted.
- Choose a heading style, list marker and code block style.
- Click Convert to Markdown or press Ctrl + Enter (Cmd + Enter on Mac).
- Click Copy result and paste the Markdown wherever you need it.
Example
Blog post HTML to Markdown
Input
<h2>Getting started</h2>
<p>Install the <strong>CLI</strong> with <code>npm i -g tool</code>.</p>
<ul><li>Fast</li><li>Free</li></ul>
<p><a href="https://example.com/docs">Read the docs</a></p>Output
## Getting started
Install the **CLI** with `npm i -g tool`.
- Fast
- Free
[Read the docs](https://example.com/docs)ATX headings, - bullets and fenced code blocks, the default settings.
Common errors and how to fix them
No readable content was found in this HTML.
The page builds its content with JavaScript, so the raw HTML is mostly empty <div>s and scripts. Copy the rendered HTML from your browser's developer tools (right-click an element → Copy → Copy outerHTML) instead.
Tables come out as plain text
Markdown tables need GitHub Flavored Markdown. Keep the GFM option on, and note that tables with merged cells (colspan) can't be expressed in Markdown.
Navigation menus and footers end up in the Markdown
Paste only the article's HTML, for example the <article> or <main> element, rather than the whole page.
Good to know
- Scripts, styles, iframes and other non-text elements are removed, so only readable content is converted.
#headings (ATX) work for all levels; underlined headings (Setext) only exist for levels 1 and 2, so lower levels still use#.- Tables, strikethrough and task lists need GitHub-flavored Markdown. With it turned off, tables become plain text.
- Characters that mean something in Markdown, such as
*or a number followed by a dot at the start of a line, are escaped with a backslash so the text stays the same. - Markdown can't express every HTML feature, such as colours, layouts or merged table cells, so that formatting is dropped.
Frequently asked questions
Can I convert a whole web page?
Yes. Paste the page's HTML source and the content of its body is converted. For cleaner results, copy just the main article HTML instead of the full page with menus and footers.
Why are some characters preceded by a backslash?
The backslash escapes characters that Markdown would otherwise treat as formatting, so 1\. stays the text "1." instead of starting a numbered list.
Which Markdown flavor does the output use?
Standard Markdown, plus GitHub-flavored tables, strikethrough and task lists when that option is on. It works on GitHub, GitLab and most Markdown editors.