Skip to content

HTML to Markdown Converter

Convert HTML to clean Markdown with a live preview. Handles tables, code blocks, and links (GFM). Copy or download the .md — free, no signup.

Updated April 21, 2026Free · No sign-upRuns in your browser
HTML
Markdown

This HTML to Markdown converter takes any HTML — a single tag, a snippet from a CMS, a whole article — and produces clean, readable Markdown in real time. Paste your HTML on the left and the equivalent Markdown appears immediately on the right. The Markdown output uses ATX-style headings, hyphen bullets, and fenced code blocks with language hints, which means whatever you produce here will render correctly on GitHub, in Obsidian, in Hugo, in Notion, and anywhere else CommonMark or GitHub Flavored Markdown is supported.

The conversion runs entirely in your browser using the well-tested turndown library with GFM extensions enabled, so tables, strikethrough, and task list items survive the round trip. Nothing is uploaded; nothing is logged. Your source HTML never leaves your device, which makes this safe to use on private content, customer data, or anything else you would not paste into an unfamiliar online tool.

The most common reasons people convert HTML to Markdown in 2026 are migrating between content management systems, archiving web articles into a personal knowledge base like Obsidian or Logseq, prepping content for a static site generator, or simply turning a styled rich-text snippet into a portable plain-text format that survives copy-paste across tools.

Use the Sample button to load a representative HTML document and see how the converter handles headings, lists, tables, code blocks, and images. When you are happy with the output, click Copy Markdown or Download .md and you are done.

What is HTML to Markdown conversion?

HTML and Markdown describe the same thing — structured text — at different levels of detail. HTML is the rendering format browsers actually consume, and it can carry arbitrary attributes, classes, inline styles, and embedded scripts. Markdown is a lightweight authoring format designed to be readable in source form and to round-trip cleanly into HTML when you publish.

Converting HTML to Markdown is the act of stripping HTML down to its semantic essentials — the heading levels, the lists, the links, the images, the code blocks — and re-expressing those structures in Markdown syntax. The result is shorter, easier to read, easier to edit by hand, and trivial to convert back to HTML when needed.

Why convert HTML to Markdown?

CMS migration. Moving content out of WordPress, Drupal, or a custom CMS into a static-site setup like Hugo, Jekyll, Astro, or Eleventy almost always means converting HTML article bodies into Markdown source files.

Personal knowledge bases. Tools like Obsidian, Logseq, and Bear store notes as Markdown files. Clipping a web article into one of these tools requires HTML-to-Markdown conversion.

AI training and prompt data. When preparing text corpora for fine-tuning or for retrieval-augmented generation, Markdown is the preferred storage format because it preserves structure without the noise of class attributes and inline styles.

Archiving and portability. A Markdown file will open in any text editor, render in any modern viewer, and survive decades of format churn. HTML with embedded CSS and JS frequently does not.

Email and Slack snippets. A formatted paragraph copied from a webpage often contains hundreds of bytes of inline styles. Converting it to Markdown first and then re-rendering produces a far cleaner result.

What gets converted vs preserved

The converter understands and translates these constructs cleanly:

  • Headings <h1> through <h6> map to # through ######
  • Paragraphs, bold (<strong>, <b>), italic (<em>, <i>), and strikethrough (<del>, <s>, <strike>)
  • Inline code <code> and fenced code blocks via <pre><code> (with language hint preserved when present as a class="language-xxx")
  • Ordered lists (<ol>), unordered lists (<ul>), and nested lists
  • Links (<a href>) — including inline title attributes
  • Images (<img>) — alt and title preserved
  • Tables (via the GFM plugin) — headers and body cells produce GFM table syntax
  • Blockquotes (<blockquote>)
  • Horizontal rules (<hr>)

These are stripped or simplified:

  • Inline style attributes are removed (Markdown has no notion of inline CSS)
  • class and id attributes are dropped except on code blocks where class="language-…" is read
  • <script> and <style> blocks are removed entirely
  • Custom elements (<my-component>) are passed through as raw HTML, which most Markdown renderers handle by preserving them as-is

Limitations and workarounds

Complex layouts lose visual structure. Markdown has no equivalent for a multi-column layout, a floated sidebar, or a CSS grid. The converter walks the DOM in source order, which usually produces a readable linear document but does not reproduce visual layout.

Inline styles are dropped. A <span style="color:red"> becomes plain <span> text in Markdown, because Markdown has no syntax for arbitrary inline styling. Restyle in your destination tool.

Custom HTML elements are passed through. Web Components and other custom tags are kept as raw HTML in the Markdown output, which most renderers preserve. If you need to strip them entirely, do a regex pass on the output afterward.

JavaScript is removed. Inline <script> blocks and onclick-style attributes are not converted to anything — they are dropped. Any behaviour they implemented must be reimplemented in the destination system.

Iframes lose their content. An <iframe> becomes a paragraph containing the iframe URL as a link, since Markdown has no <iframe> syntax in CommonMark. Re-embed manually in the target platform.

Common conversion scenarios

WordPress to Hugo or Jekyll. Export your WordPress posts as XML, run each post body through this converter, save the result as a .md file with the appropriate front matter at the top, and your static site can serve them directly.

Web article to Obsidian or Notion. Copy the article HTML from “view source” or from a saved webpage, paste it here, copy the Markdown output, and create a new note in your knowledge tool.

Email HTML to plain notes. Many email clients store messages as HTML. Pasting an HTML email body here gives you a clean text version suitable for note-taking, search, or sharing.

Documentation site to README. Many companies maintain product docs on a marketing site and a simplified version in a GitHub README. Converting the source HTML is faster than rewriting from scratch.

Best practices for clean Markdown output

  • Strip wrapper elements first. If your HTML is wrapped in <html>, <body>, <nav>, <header>, and <footer>, paste only the <article> or <main> body. The wrapper navigation rarely translates to meaningful Markdown.
  • Remove tracking and ad markup. Analytics snippets, pixel trackers, and ad container divs add noise to the Markdown output. Delete them in the source before converting.
  • Normalise list markers. Mixed <ul> and <ol> nesting can sometimes confuse parsers; the converter handles common cases correctly but very deep nesting may need a manual review.
  • Check tables on the other side. GFM table syntax has minor rendering differences across tools — verify your output renders correctly in your destination before bulk-converting many files.

Frequently Asked Questions

Does this preserve images?

Yes. <img> tags are converted to Markdown image syntax with alt text and title preserved. The image URL itself is not modified — relative URLs stay relative, absolute URLs stay absolute. If your destination needs hosted images, you will still need to upload them separately.

What about tables?

Tables are converted using the GitHub Flavored Markdown plugin, which produces standard GFM table syntax with pipe-separated cells and a divider row. Header cells render as bold in the Markdown source. Cell alignment attributes are preserved where present.

Are CSS styles preserved?

No. Markdown has no syntax for inline styles, so any style="...", class="...", or <style> blocks are stripped. The exception is class="language-xxx" on code blocks, which the converter reads to set the language hint on the fenced code block.

Can I convert an entire web page?

You can paste the full HTML of a page, but the output will include navigation, header, and footer content alongside the main article. For best results, paste only the inner <article> or <main> element.

Is my HTML stored?

No. The conversion runs entirely in your browser. No HTML is uploaded, logged, or stored on any server. Close the tab and the source is gone.

Why is my output cluttered with HTML still?

The converter preserves HTML it cannot meaningfully translate — custom elements, complex nested divs, or markup with attributes Markdown does not support. If you see leftover HTML, either simplify the source before pasting or do a regex cleanup pass on the output.

Can I save my conversion settings?

Conversion settings are fixed for consistency: ATX headings, hyphen bullets, fenced code blocks, asterisk emphasis, double-asterisk strong, inline links. These are the GFM-standard defaults that produce the most portable Markdown.

Does this handle JavaScript-rendered content?

Only the static HTML you paste is converted. If a page renders content dynamically via JavaScript, you need to view the rendered DOM (in DevTools, copy outerHTML from the element) and paste that — the original raw HTML source will not contain the dynamically-added content.

Data accurate as of: May 2026