HTML to Markdown

Convert HTML to clean Markdown.

About HTML to Markdown

An HTML to Markdown converter turns a page or fragment into Markdown. Headings, lists, links, images, code and regular tables are kept; scripts are dropped.

How to use

  1. Paste HTML or load an .html file. A fragment or a whole document both work; the Markdown appears as you type.
  2. Choose the heading style: # prefixes (ATX) or underlined (Setext, for the first two levels).
  3. Choose the bullet marker (-, * or +) and the code block style: fenced with backticks or indented by four spaces.
  4. Copy the Markdown or download it as .md, named after the loaded file.

What it does

  • Converts with the turndown library: headings, paragraphs, bold and italic, links, images, ordered and unordered lists, blockquotes, inline code, pre blocks and horizontal rules all map to their Markdown equivalents.
  • Removes script, style, head, title and noscript elements, so pasting a full page leaves only its content.
  • Writes a GFM pipe table when every row of a table has the same number of cells, using the first row as the header. Tables with spanning or uneven rows fall back to their text content.
  • Elements with no Markdown equivalent, such as div, span and iframe, contribute their text and lose their tags. Inline styles, classes and ids are discarded.
  • Does not fetch anything: image and link URLs are copied as written, relative paths included.

Example

<h2>Install</h2><p>Run <code>npm i</code>, then see the <a href="/docs">docs</a>.</p>
→
## Install

Run `npm i`, then see the [docs](/docs).

Privacy

Conversion runs in the browser. No request is made, and nothing is stored.

Frequently asked questions

Can I convert a whole web page to Markdown?
Yes. Save the page as HTML or copy its source, paste it in, and the converter drops the head, scripts and styles and converts the body. Navigation menus and footers come through as lists and text, so some trimming is normal.
Why are my tables converted to plain text?
Markdown tables need a regular grid. If a row spans columns or rows have different cell counts, there is no faithful pipe-table equivalent, so the cell text is kept in reading order instead.
What is the difference between ATX and Setext headings?
ATX headings use one to six # characters before the text, for example "## Title". Setext headings underline the text with = for level one or - for level two and have no form for deeper levels, so levels three to six use # even in Setext mode.