Data Tools

HTML to Markdown Converter

Paste HTML or choose an .html file and get tidy Markdown back: headings, lists, links, images, quotes, code blocks and tables, ready for a README, a wiki or a notes app. Scripts and styles are thrown away first, and nothing leaves your browser.

Free · No sign-up · Files stay on your device

By Aditya Kr Sharma

  • Free
  • Instant
  • No sign-up

HTML to Markdown

Or import from
Supports: HTMLHTMTXT

Files are not uploaded - everything happens in your browser.

Need it the other way? Convert Markdown to HTML →

How to use the HTML to Markdown tool

  1. Paste the HTML into the box, or choose an .html file.
  2. Choose whether to keep images, how links are written and which bullet character to use.
  3. Press Convert and check the preview.
  4. Press Copy to put the Markdown on your clipboard, or download the .md file.

Why convert HTML to Markdown

Markdown is the plain-text format behind README files on GitHub and GitLab, documentation sites, wikis, static site generators and note-taking apps such as Obsidian, Joplin and Logseq. HTML is what web pages, emails and most rich-text editors produce. When content has to move from one world to the other, for example a help article moving into a documentation repository, a blog post moving to a new static site, or a web page saved as a note, pasting raw HTML leaves a mess of tags. This converter turns the structure of the HTML into the matching Markdown syntax instead.

The conversion runs in your browser using Turndown, a well-known open-source HTML-to-Markdown library, with additions for tables, strikethrough and task lists. Nothing is uploaded.

What carries over

Headings h1 to h6 become # to ###### headings. Paragraphs, line breaks, bold and italic text, inline code and links come across as you would expect. Ordered and unordered lists keep their nesting, and checkbox lists become GitHub task lists with [ ] and [x]. Block quotes become > quotes, pre and code blocks become fenced code blocks with three backticks, horizontal rules become ---, and del, s and strike become ~~strikethrough~~.

Tables are converted to GitHub-flavoured Markdown tables, with a header row, a separator line and column alignment taken from the first row where the HTML sets it. Pipe characters inside cells are escaped so they do not break the table. Merged cells cannot be expressed in Markdown, so a cell that spans two columns is written once and the row is padded.

Images become ![alt text](address) using the alt text from the HTML, which is worth having for accessibility. If you only want the words, untick "Keep images" and they are dropped.

What is removed

Before conversion, scripts, style blocks, comments, iframes, embedded objects, canvas elements and forms are removed, and so are event-handler attributes. None of that has a meaning in Markdown, and leaving it in would only fill the output with code. With "Body only" ticked, which is the default, everything in the head of the document, such as the title, meta tags and linked stylesheets, is ignored too.

Layout is the other thing that does not survive. Markdown has no columns, no colours, no font sizes and no boxes, so a page built from many nested div elements becomes a run of plain paragraphs in reading order. Navigation menus, headers and footers on a saved web page are still text and will appear in the result, so for a whole saved page it is usually quicker to copy just the article part of the HTML and convert that.

Link style and bullet character

Links can be written inline, as [text](https://example.com), which keeps each link next to its words and is what most people expect. The referenced style writes [text][1] in the text and collects all the addresses at the end of the document, which keeps long paragraphs readable when there are many links.

Bullet lists can use a dash, an asterisk or a plus sign. All three mean the same thing in Markdown; pick the one your project or style guide uses so the file does not need reformatting later. Many linters and formatters such as Prettier default to the dash.

Paste or file

You can paste HTML straight into the box, which is handy for a snippet copied from a page's source, an email template or a CMS editor in code view. For whole files, choose or drop the .html file. The Markdown appears in a preview below the button, the word count is shown, and you can copy it to the clipboard with one click or download it as a .md file.

If you copy text from a web page normally, without viewing its source, you get plain text rather than HTML, and there is nothing for the converter to work with. Use the browser's View Source or the developer tools to copy the HTML itself.

After converting

Read through the preview before you use the result. Converters follow the HTML faithfully, so if the source used a bold paragraph instead of a real heading, the Markdown will have bold text rather than a # heading, and you may want to fix that by hand. Empty links, decorative images and leftover navigation text are also easy to spot and delete at this stage.

Privacy

The HTML is processed inside this browser tab. Nothing is uploaded, no account is needed, and nothing in the HTML is run: it is read as text and its structure is converted.

Frequently asked questions

Are tables converted?

Yes, to GitHub-style Markdown tables with a header row and column alignment.

Can I paste instead of choosing a file?

Yes. Paste the HTML straight into the box and press Convert.

What happens to scripts and styles?

They are removed before conversion, along with comments, iframes, forms and event handlers.

Why is my layout gone?

Markdown has no layout. Columns and boxes built from nested divs become plain paragraphs in reading order.

Can I remove the images?

Yes. Untick "Keep images" and image tags are dropped from the result.

What is the referenced link style?

Links are written as [text][1] with all the addresses listed at the end, which keeps paragraphs with many links easier to read.

Is my HTML uploaded?

No. It is converted entirely in your browser.

More in Data Tools All tools