How to convert HTML to Markdown, free and without uploading
To convert HTML to Markdown, paste your HTML into the HTML Input box. The Markdown Output box fills in a moment after you stop typing, or at once when you click Convert. Click Copy Markdown to copy the result, or Download .md to save it as converted.md. You can paste a small fragment or a whole saved web page, because the head, title, scripts and styles are ignored. The output is GitHub Flavored Markdown, so headings, bold, italic, links, images, nested lists, task lists, code blocks, tables and strikethrough carry over.
It runs in your browser; nothing is uploaded (you can check the Network tab in DevTools). Your browser parses the HTML with its own DOMParser, which does not run scripts or load images from the pasted code. The only extra request is a script file from this site that holds the Turndown conversion library, loaded the first time you convert to Markdown. None of your HTML travels with it. There is no account and nothing to install.
HTML to Markdown conversion swaps tags for the short text syntax used by README files, wikis, static site generators and note apps. An <h2> becomes ##, <strong> becomes **bold** and a link becomes [text](url). Markdown cannot describe layout, so div, span, classes and inline styles disappear and only the text stays.
To go the other way, use the Markdown to HTML converter. If the source is a tangle, run it through the HTML beautifier first, and tidy the result afterwards in the Markdown editor.
Table of Use: what each HTML element becomes
| In your HTML | Markdown output | Note |
|---|---|---|
<h2>Hello <em>there</em></h2> | ## Hello *there* | h1 to h6 become # to ######, always on one line |
<strong>Bold</strong> <em>it</em> <del>gone</del> | **Bold** *it* ~~gone~~ | b, i, s and strike work too |
<a href="/docs" title="Docs">the docs</a> | [the docs](/docs "Docs") | A link with no href keeps its text and loses the tag |
<img src="a.png" alt="Logo"> |  | A title attribute is kept too |
<ol start="3"><li>three</li><li>four</li></ol> | 3. three
4. four | The start number is kept; bullets use a dash and nested lists are indented |
<li><input type="checkbox" checked> done</li> | - [x] done | An unchecked box gives - [ ] |
<pre><code class="language-python">print(1)</code></pre> | ```python
print(1)
``` | The language comes from a language-xxx or lang-xxx class |
<table> with th and td cells | | A | B |
| --- | --- | | GitHub Flavored Markdown pipe table; the first row is the header |
<p>2 * 3 and [x]</p> | 2 \* 3 and \[x\] | Characters with a Markdown meaning are escaped |
<div>, <span>, <sup>, <u>, <mark> | Text only | No Markdown form, so only the text is kept |
<script>, <style>, comments, empty <iframe> or <video> | Removed | Nothing is written for them; text inside an iframe or video is kept |
Entities such as & and © are decoded to the characters they stand for. To turn those characters into entities and back on their own, use the HTML entity decoder and the HTML entity encoder.
Features
- Standard Markdown style. Headings use
#, bullets use-, emphasis uses*and**, code blocks use triple backticks and a horizontal rule is---. Tables, task lists and strikethrough are GitHub Flavored Markdown extensions. - Converts as you type. The output refreshes about 0.12 seconds after you stop typing, or 0.4 seconds when the input is over 200,000 characters. Convert runs it again and is disabled while the input is empty.
- Size counters. Each box shows its line and character count; the built-in sample goes from 58 lines and 1,188 characters to 30 lines and 558 characters.
- Careful tables. Rows are padded to the same number of columns, colspan is expanded, a table caption becomes a line of text above the table, and
alignattributes ortext-alignstyles on the cells of the first row set the column alignment. - Code blocks that survive. Any pre element becomes a fenced block with its line breaks and indentation intact. If a line of the code starts with three backticks, the fence is made longer so the block does not close early.
- Safe escaping. Plain-text characters that Markdown would read as syntax are escaped, and a
!right before a link is escaped so it cannot turn the link into an image. - Strip all HTML tags (plain text only). One checkbox switches the output to plain text. The output box becomes Plain Text Output and the buttons become Copy Text and Download .txt.
- Copy, download, clear. If the browser blocks clipboard access, a message asks you to copy it yourself. Clear empties both boxes.
How to use the HTML to Markdown converter
- Paste your HTML into the HTML Input box, or edit the sample that is already there. Click Clear first to empty it.
- Leave Strip all HTML tags (plain text only) unticked for Markdown, or tick it for plain text.
- Read the result in Markdown Output. It updates as you type; click Convert if you want to run it again.
- Click Copy Markdown to copy it, or Download .md to save
converted.md. - Check tables and any element with no Markdown form, then paste the result into your editor.
Who can use it
- Developers and technical writers turning HTML documentation into a README or wiki page, with code samples they can show using the code syntax highlighter.
- Bloggers and site owners moving HTML posts into a Markdown-based static site, with the slug generator for the new file names.
- Note-takers who save an article as HTML and want Markdown, or plain text to count with the word counter.
- Support and content teams quoting an HTML email body, cleaning it with find and replace and comparing versions in the text diff tool.
- Anyone unsure what the HTML contains can look at it first in the HTML previewer.
FAQs
How do I convert HTML to Markdown?
Paste your HTML into the HTML Input box, either a whole page or just a fragment. The Markdown Output box updates a moment after you stop typing, or at once when you click Convert. Click Copy Markdown to copy it, or Download .md to save converted.md. The head, title, scripts and styles of a full page are ignored, so you can paste a saved web page as it is.
How do I convert an HTML table to Markdown?
Paste the table and the converter writes a GitHub Flavored Markdown pipe table. The first row becomes the header, rows are padded to the widest one, colspan cells are followed by empty cells, and a pipe inside a cell is escaped as \|. Cells with rowspan are not repeated and lists inside a cell are joined onto one line, so check those tables by hand.
Can I convert a whole web page to Markdown?
Yes. Open the page source or save the page as HTML and paste it; the head, scripts and styles are ignored. Menus, sidebars and footers are ordinary elements, so their text and links are converted too; delete them from the input if you only want the article. Content that a script adds after the page loads is not in the saved source.
What does "Strip all HTML tags" do?
It turns the HTML into readable plain text instead of Markdown. Headings and paragraphs are separated by blank lines, list items start with a dash or a number, table cells are separated by tabs, and image alt text is kept. Links keep their text but not their URLs. The buttons change to Copy Text and Download .txt, which saves converted.txt.
Why are some characters escaped with a backslash?
Characters such as *, _, `, [, ] and ~, or a # or - at the start of a line, mean something in Markdown. When they are ordinary text in your HTML, the converter puts a backslash in front so the Markdown shows the same text instead of formatting. Underscores inside words, as in snake_case, are left alone.
What is lost when HTML becomes Markdown?
Markdown has no syntax for layout or styling, so classes, ids, inline styles and colours are dropped. Tags with no Markdown form, such as sup, sub, u, mark and kbd, keep only their text, so a superscript 2 comes out as a plain 2. Comments and empty iframes or videos are removed, while text inside an iframe or video is kept, and definition lists become plain paragraphs.
Is my HTML uploaded to a server?
It runs in your browser; nothing is uploaded (you can check the Network tab in DevTools). Your browser parses the pasted HTML with its own DOMParser, which does not run scripts or load images from it. The only extra request is a script file from this site that holds the Turndown conversion library, fetched the first time you convert to Markdown, and it carries none of your HTML.