HTML to Markdown

Convert HTML into clean, configurable Markdown with live preview, GFM tables/task lists, HTML validation, and stats — entirely in your browser.

Loading tool…

HTML and Markdown, and why you would convert

Markdown is a lightweight plain-text syntax created by John Gruber in 2004, designed so that a document reads naturally even before it is rendered: asterisks for emphasis, hashes for headings, hyphens for lists. It has become the default writing format for developers — README files, documentation sites, static blogs, wikis, and issue trackers all speak it.

HTML is far more expressive, which is what makes the conversion lossy by nature. Headings, paragraphs, links, images, lists, code blocks, blockquotes, and tables all have clean Markdown equivalents. Inline styles, classes, layout divs, and scripts do not, and are either dropped or preserved as raw HTML, since Markdown permits embedded HTML. Knowing that in advance sets the right expectation: you get the content and its structure, not the visual design.

Why we built this tool

The usual job is rescuing content from a page — moving a published article into a documentation repository, importing an old CMS export into a static site generator, or cleaning something pasted out of a word processor into publishable text.

Drafts, internal documentation, and client content are all things you would rather not upload to an unknown converter. Our tool parses the HTML with the browser's own DOM parser and walks the tree to emit Markdown, entirely on your device. No upload, no size limit, no retention — and it works offline once the page has loaded, which suits the batch-conversion sessions this task usually turns into.

Tips and common mistakes

  • Tables and nested lists are where converters differ most — check those first in the output.
  • Inline styles, classes, and layout wrappers have no Markdown equivalent and will be dropped.
  • Convert relative image and link paths to absolute ones if the content is moving to a different site.
  • Markdown permits embedded HTML, so keep raw markup for anything the syntax cannot express.

Open HTML to Markdown with a link

Assistants and scripts can open HTML to Markdown with its input already in the link, after the #, which never leaves your device:

  • #text= — the text to work on
  • #html= — the HTML

Example: https://mygadgets.ink/tools/html-to-markdown/#text=...&html=... · also compressed gz fields and ?url=. How tool links work

Quick start: using HTML to Markdown

  1. Paste the HTML you want to convert into the input above.
  2. Run the conversion and read the Markdown output.
  3. Check tables, nested lists, and code blocks first — those are where converters differ most.
  4. Clean up any leftover raw HTML you do not need.
  5. Copy the Markdown into your repository or CMS.

Going the other way is Markdown to HTML, and Remove Formatting strips a document down to plain text.

Why convert HTML to Markdown

Markdown is the lingua franca of documentation — GitHub, static site generators, note apps, and wikis all speak it. It is far easier to read and edit in raw form than HTML, and it stays clean in version control. Converting lets you lift content from a web page or a rich-text export and drop it into a Markdown-based workflow without hand-stripping every tag.

What converts cleanly

Markdown has direct equivalents for the common HTML elements, so these map perfectly:

  • Headings (<h1>–<h6>) become # through ######.
  • Bold and italic become ** and *.
  • Links and images become [text](url) and ![alt](src).
  • Lists — ordered and unordered — become 1. and -.
  • Blockquotes become >, and inline code becomes backticks.

For article and documentation content, the conversion is usually near-perfect.

What does not map

Markdown is deliberately simple, so anything HTML does that Markdown cannot express gets dropped or passed through as raw HTML:

  • Complex tables with merged cells or styling — basic tables convert, fancy ones do not.
  • Inline styles, classes, and colors — Markdown has no concept of them.
  • Nested layout <div>s and custom components — these carry no meaning in Markdown.
  • Scripts, forms, and interactive elements — no equivalent at all.

Expect to tidy the output a little for pages that were heavy on layout rather than content.

Common uses

  • Move web content into a README or wiki.
  • Convert a rich-text export to clean Markdown.
  • Migrate articles into a static site generator.
  • Strip HTML clutter from copied content.

Related Developer Tools

Browse all Developer Tools →