Convert HTML to Markdown

Convert HTML to clean Markdown with headings, links, bold and italic, nested lists, code blocks, quotes, tables and images kept. Runs in your browser.

How to convert HTML to Markdown

  1. 1

    Paste the HTML or open an .html file

  2. 2

    Press Convert to Markdown

  3. 3

    Copy or download the .md file

Markdown that keeps the links and the structure

HTML copied from a web page, an email or a content system is hard to edit by hand. Markdown keeps the same structure in plain text that reads well on its own and goes straight into a README, a static site, a wiki or a note-taking app. Paste the HTML, or open a saved .html file, and the converter writes the Markdown.

What maps to what

Headings become # to ######. Paragraphs are separated by a blank line. A link becomes text, and an address with spaces or brackets is wrapped in angle brackets so it stays one link. Strong and b become bold, em and i become italic, del and s become strikethrough. Inline code takes enough backticks to hold any backticks inside it, and a pre block becomes a fenced block, with the language taken from a class such as language-js.

Lists keep their nesting, with each level indented under its parent’s text, and an ordered list keeps its start number. A block quote is prefixed with >, and a table becomes a GitHub Flavored Markdown table with its first row as the header; cells spanning columns are padded so the columns still line up. Images become ![alt](address), and a br becomes a hard line break.

How it reads the HTML

There is no browser document in the background worker that handles long pastes, so the HTML is read by a small parser written for this job. It removes comments, scripts, styles and the head first, decodes entities such as & and  , and builds the element tree with the same allowances a browser makes for the usual slips. Spaces are collapsed as a browser collapses them, except inside pre.

Escaping

Markdown gives meaning to some ordinary characters, so text that contains them is escaped with a backslash, and the result shows the same words the page did.

To go the other way, use Markdown to HTML, and to keep only the words, Remove HTML tags.

Nothing is uploaded. The HTML is converted in this tab.

Everything you need

Links and emphasis kept

Every link keeps its address and title, and bold and italic keep their markers with spaces outside them.

Lists, code and tables

Nested lists, fenced code with its language, block quotes and GitHub-style tables.

Private by design

The HTML is converted in your browser and never sent anywhere.

Nothing uploaded: open the Network panel while it runs and check.

No daily limits or watermarks: free batches take up to 20 images.

Works offline: once the page has loaded, on any current browser.

Frequently asked questions

What does it keep?

Headings, paragraphs, links with their titles, bold, italic, strikethrough, inline code, code blocks with their language, block quotes, ordered and unordered lists nested to any depth, tables, images, line breaks and horizontal rules.

What happens to scripts, styles and layout?

Scripts, styles, comments and the page head are removed with their contents. Elements Markdown has no form for, such as div, span or font, are dropped and their text kept, so the words and their order survive.

Why are some characters written with a backslash?

Text that contains *, _, [ or a figure and full stop at the start of a line would turn into emphasis, a link or a list in Markdown. The backslash keeps it as the plain character it was in the HTML.

Does it handle broken HTML?

The common mistakes, yes. A paragraph or list item left open closes when the next one starts, a stray closing tag is ignored, and a tag left open closes with its parent. It does not run a browser's full repair algorithm, so very tangled markup may nest differently.

Sources

Related guides

Work with files privately and confidentlyPractical, sourced explanations for safer file conversion, sharing, and cleanup.