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
- Paste HTML or load an
.htmlfile. A fragment or a whole document both work; the Markdown appears as you type. - Choose the heading style:
#prefixes (ATX) or underlined (Setext, for the first two levels). - Choose the bullet marker (
-,*or+) and the code block style: fenced with backticks or indented by four spaces. - Copy the Markdown or download it as
.md, named after the loaded file.
What it does
- Converts with the
turndownlibrary: headings, paragraphs, bold and italic, links, images, ordered and unordered lists, blockquotes, inline code,preblocks and horizontal rules all map to their Markdown equivalents. - Removes
script,style,head,titleandnoscriptelements, 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,spanandiframe, 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.