HTML to Markdown screenshot

HTML to Markdown

Convert HTML back to Markdown for migration and editing.

Privacy First
0 Runs
Updated 2026-11-07
Runs in your browser
No account needed
Your file is not uploaded
Works offline after load

Convert HTML back to Markdown for migration and editing. Paste your content and get an instant result.

Paste HTML or open an `.html`, `.htm` or `.txt` file and this page returns Markdown: headings, paragraphs, fenced code, blockquotes, lists, tables, horizontal rules, links, images and inline emphasis.

It reads the markup with a lenient parser that follows written rules rather than the browser's HTML5 repair, so the same input gives the same Markdown everywhere and a missing closing tag does not produce a different tree in a different browser.

The download is a `.md` file named `document-` plus the date and time, so two exports do not overwrite each other. The file is read in the tab and is never uploaded.

What becomes what

Headings become `#` runs of the same level. Paragraphs become blocks separated by a blank line. A `pre` wrapping a `code` becomes a fenced block, and a `language-…` class on that code element becomes the fence's language.

Lists become `-` or `1.` runs, with an ordered list's `start` attribute preserved, and continuation lines indented so a multi-line item stays one item. Tables become GitHub-flavoured tables with escaped pipes.

Inline `strong`, `em`, `del` and `code` become the matching delimiters, and anchors become `[label](href)`. An anchor with no label is dropped, because it would produce an empty link.

  • Blocks: headings, paragraphs, pre, blockquote, lists, tables, hr
  • Inline: strong, em, del, code, a, img
  • Dropped entirely: script, style, noscript, template, head, iframe, object

What the Markdown loses

Classes, ids, data attributes, inline styles and every other presentational attribute are discarded. The Markdown keeps structure, and structure is all it keeps.

An unknown element is unwrapped rather than dropped: its children are converted and its tag disappears, so a `<section>` full of paragraphs becomes those paragraphs. That is why a custom component's content survives while its wrapper does not.

How to use the markup input

Paste the HTML into the input workspace or open an `.html`, `.htm` or `.txt` file. The lenient reader follows written rules rather than browser repair, so the same input yields the same tree everywhere, and conversion starts as you type.

Copy the Markdown or press Download to save the dated `document-` `.md` file: headings, fenced code, lists, tables, links and emphasis preserved. The file is read in the tab and never uploaded.

What to Expect

Best for

  • Turning a page fragment into Markdown for a README or a wiki
  • Rescuing content from markup whose styling you do not want
  • Converting a documentation export back into editable Markdown

Not ideal for

  • Preserving classes, styles or script behaviour, all of which are dropped
  • A page that depends on JavaScript to render its content
  • Pixel-accurate reproduction of the original layout

What this tool keeps

  • Heading levels and list nesting
  • Link targets and image sources
  • The language class on a fenced code block

What may need cleanup

  • Table column alignment, which is emitted as a plain divider
  • Whitespace inside a paragraph, which is collapsed
  • Interleaved inline elements, which can produce nested delimiters a reader dislikes

Common errors

  • Pasting a full page and finding the head and scripts gone, which is by design
  • Expecting inline styles to survive
  • Reading an empty result as a parser failure when the body held only scripts

Example use cases

  • A CMS article exported to Markdown
  • A documentation page moved into a repository
  • An email template's body reduced to editable text

Sample input

A fragment with an h2, a paragraph containing emphasis and a two-column table.

Sample output

A heading, a paragraph with inline emphasis, and a Markdown table whose cells keep their text.

Who this is for

  • Developers moving docs into a repository
  • Writers recovering text from a CMS export
  • Anyone who needs editable Markdown from a page

Want the other direction? Use the Markdown to HTML.

Frequently asked questions

Which HTML elements become Markdown?

Headings, paragraphs, fenced code, blockquotes, lists, tables, horizontal rules, links, images and inline emphasis.

Does the conversion keep classes, styles or scripts?

No. Classes, styles and script behaviour are all dropped.

What happens to a table's column alignment?

Alignment is emitted as a plain divider row, so a viewer's alignment preference is not preserved.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.