HTML to Markdown Converter - Clean Markdown from Any Page
Convert HTML to Markdown
Scripts, styles and embedded media are dropped; unknown tags keep their text. Tables become GFM tables.
Turning HTML into Markdown
Moving a blog post into a README, a documentation page into a wiki or a web article into your notes means getting rid of the HTML without losing the structure. This converter parses the markup the way a browser does and writes the equivalent Markdown — headings stay headings, nested lists stay nested, tables stay tables — while scripts, styles and tracking pixels disappear.
Steps
- 1 Paste the HTML — a whole page or a fragment — into the top box. In most browsers you can right-click a page and choose View source to copy it.
- 2 Read the Markdown below; it updates as you type. Nested lists, code blocks with a language and tables with alignment are preserved.
- 3 Copy the result or download it as a .md file.
What converts to what
Headings h1 to h6 become hash headings; p becomes a paragraph, br a hard line break and hr a rule. strong and b become double asterisks, em and i single asterisks, del and s double tildes, code becomes backticks and pre a fenced block that keeps a language class as the fence label. Links become [text](url), images ; ul and ol become dash and numbered lists with two-space nesting; blockquote becomes lines prefixed with a greater-than sign; table becomes a GFM table with alignment taken from align attributes or text-align styles.
Why it works on the DOM, not on text
Regular expressions cannot handle HTML reliably: tags nest, attributes contain angle brackets inside strings, and real pages are rarely well formed. The converter hands the HTML to the browser's own parser, which repairs unclosed and misnested tags exactly as it would when rendering, and then walks the resulting tree. That is why a link inside bold inside a list item comes out right.
What is dropped and what is kept
script, style, head, noscript, template, iframe, object, embed, svg, canvas, video and audio are removed with their contents — none has a Markdown equivalent and most are noise. Everything else that is not recognised keeps its text: a custom element, a span or a div is treated as a container and its children are converted. Inline formatting inside unknown tags therefore survives.
Escaping and clean output
Characters that would change meaning in Markdown — asterisks, underscores, backticks, backslashes, and a hash or dash at the start of a line — are escaped in text so that converting the Markdown back to HTML gives the same result. Whitespace is collapsed as a browser would collapse it, except inside pre. Blank lines are reduced to one between blocks.