Skip to content
PocketDesk
Your files are processed on your device, never uploaded

HTML to Markdown

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Run now
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to convert HTML to Markdown

  1. Paste your HTML into the left box, or drop a .html file on it.
  2. The Markdown appears on the right straight away.
  3. Choose the heading style, bullet marker and code block style at the top if you want a different look, then select Copy or Download.

You can paste a whole page or only a snippet, such as the content of one article.

What the converter does

HTML describes structure with tags, while Markdown uses simple marks in plain text. The converter reads the HTML with your browser’s parser and walks through it: a <h2> becomes ##, <strong> becomes double asterisks, <a href> becomes a link in square brackets and <li> becomes a list item. It uses the Turndown library, which is widely used for exactly this job.

Some things do not have a Markdown form. Inline styles, colours, classes and layout tables are dropped or simplified, because Markdown only describes the structure of the text.

Common uses

  • Move a blog post or help article from a CMS into a Git repository of Markdown files.
  • Clean up text copied from a web page before pasting it into notes.
  • Turn an HTML email into plain readable text.
  • Prepare content for a static site generator.

Tips

  • Remove navigation, headers and footers from the HTML first. The converter does not know which parts are the main article.
  • Check links after converting. Relative links stay relative, so they may need a full address.
  • Images become ![alt](src). Inline images stored as Base64 can be very long; consider saving them as files.
  • To check the result, paste the Markdown into Markdown to HTML and compare the preview.
  • Need to find and replace patterns across the output? Try the regex tester first.

Your HTML never leaves your device, and nothing is stored once you close the page.

Questions

What HTML does it understand?

Common elements: headings, paragraphs, bold and italic, links, images, lists, quotes and code. Tables and unusual tags are kept as HTML or simplified.

Are scripts and styles removed?

Yes. Script and style elements are dropped from the result.

Can I choose the Markdown style?

You can pick hash or underlined headings, the bullet character and fenced or indented code blocks.

Is my HTML uploaded?

No. The conversion runs in your browser. Nothing leaves your device.

More developer tools