tools / code converters / html-to-markdown

html-to-markdown

Converts HTML to Markdown. Handles headings, paragraphs, links, images, lists, code blocks, blockquotes, bold, italic, tables, and more. Strips unsupported attributes with warnings.
Runs locally in your browser. Enable JavaScript to use the interactive tool. The practical details remain available below.

What html-to-markdown actually does

Converting HTML to Markdown looks like tag substitution and is mostly an escaping problem, because the two languages disagree about where markup stops. Two cases account for most of the damage. The first is a code block. HTML writes a less-than sign inside a code sample as an entity, and a browser shows the reader the character. Markdown does not resolve entity references inside code spans or fenced blocks, which CommonMark states outright, so a converter that copies the entity across hands the reader the entity itself: the sample now reads with a stray ampersand-l-t in it. The characters have to be decoded on the way out precisely because Markdown will not decode them later. The second is a table. A pipe inside a cell is a cell boundary to GFM, and a row with more cells than the header has its excess discarded, so a cell containing an option list or a regular expression loses everything after the first pipe and the table still renders, looking fine. Both were live defects in this tool until 2026-08-22, along with a third: the entity decoder resolved the ampersand first, so an author who wrote an escaped entity to display an entity got a bare character instead. The results are now checked by rendering them with an independent Markdown renderer and reading what the reader would see.

How to use it

  • Paste the HTML, or drop a .html file on the left pane. It is parsed in this tab.
  • Press Convert, or cmd+enter.
  • Read the Markdown on the right and edit anything the conversion could not decide.
  • Switch to Checks: fences are checked for a closing pair and every table row is counted against its header, with escaped pipes counted as content rather than boundaries.
  • Use Diff to see the shape change from markup to Markdown.
  • Copy or download the pane. Restore puts the conversion back.

Useful for

  • Move a page or an article into a documentation repository that keeps its source in Markdown.
  • Turn an exported help center article into something a static site generator can build.
  • Get a table out of a page and into a README without discovering later that a cell lost half its text.
  • Extract a code sample from a rendered page with the characters the author actually wrote.

Limits worth knowing

  • Inline HTML with no Markdown equivalent is passed through and flagged in a comment. Markdown allows raw HTML, so this preserves the page rather than dropping it, and it means a script tag in the input is a script tag in the output.
  • Attributes other than href, src, alt, title and lang are stripped, with the list of what went reported at the top.
  • Nested tables, cells spanning rows or columns, and captions have no GFM equivalent and are flattened.
  • Definition lists, figures and details blocks are not part of GFM and come through as their text.
  • The Checks tab reads structure. It does not render the Markdown, so it can tell you a row is short but not how a particular renderer will lay it out.

Questions people ask

undefined

undefined

undefined

undefined

undefined

undefined

undefined

undefined