HTML to Markdown converter

Paste HTML code, or text copied from a web page, and get clean GitHub Flavored Markdown to copy or download.

Converter

document.md
The Markdown appears here when you paste.

Jotura, a free notes app, saves every note as a plain Markdown file, including text you paste in with its formatting. Download Jotura

How to use it

  1. Add the HTML. Paste it into the box, drop an .html file on it, or press Open an .html file. For text copied from a web page, switch to Formatted text and paste there.
  2. Check the Markdown. It appears on the right as soon as the HTML changes. Try an example shows how lists, tables and code come out.
  3. Copy or download. Copy Markdown puts the result on the clipboard and Download .md saves it as a file.

What each HTML element becomes

HTMLMarkdown
<h2>## Heading
<strong>, <em>, <del>**bold**, *italic*, ~~gone~~
<a href>[text](address)
<ul> and <ol>, nested or not- and 1. lists, indented under their parent item
A checkbox in a list item- [x] item
<pre><code class="language-js">A fenced code block marked js
<table>A pipe table
<blockquote>, <hr>> quote, ---

Questions

How do I convert HTML to Markdown?

Paste the HTML into the box at the top of this page, or press Open an .html file. The Markdown updates as you type. Copy Markdown puts it on the clipboard and Download .md saves it as a file named after the first heading. To convert part of a web page without its source, select it in the browser, copy it, switch to Formatted text and paste.

Which Markdown does it write?

GitHub Flavored Markdown, which Obsidian, Jotura, GitHub and most other Markdown tools read. Headings use #, lists use - and 1., code blocks are fenced with three backticks, and checkboxes become task list items such as - [x] Done.

Does it convert HTML tables?

Yes. A table becomes a pipe table with its columns lined up, and the first row becomes the header. Cells keep bold, italics, code and links, and a line break inside a cell becomes <br>. Merged cells are padded with empty ones so every row has the same number of columns. To convert a table on its own and set the alignment of each column, use the HTML table to Markdown tool.

What happens to images and links?

An image becomes ![alt text](address) and a link becomes [text](address), with relative addresses kept as written. Images whose address points at your own computer or is embedded in the page as data are left out, since a Markdown file cannot carry them. Links that start with javascript: are dropped and their text kept.

What gets removed?

Scripts, styles, comments, forms and the page head are dropped, along with classes, inline styles and wrapper elements that hold no text. The text inside them stays. Extra spaces and line breaks collapse the way a browser shows them, and code blocks keep their whitespace exactly.

How do I convert HTML to Markdown on the command line?

Pandoc converts a file in one line. For JavaScript projects the turndown package does the same job in code, and for Python there is markdownify.

pandoc -f html -t gfm page.html -o page.md

Is my HTML uploaded?

No. The HTML is read and converted by JavaScript in your browser, and nothing you paste is sent to a server or saved. Pasted HTML is parsed as an inert document, so its scripts never run and its images never load.

Other converters: Google Docs to Markdown, Rich text to Markdown, Word to Markdown and Evernote to Markdown.