FormatArcSimple Data Converter
HTMLMarkdownconversion

How to Convert HTML to Markdown

Convert HTML to Markdown in the browser. Covers practical use cases like WordPress migration, Notion export cleanup, and web page clipping, plus CLI alternatives.

FormatArc HTML to Markdown conversion result
Table of contents
  1. Quick answer
  2. When the conversion comes up
  3. Migrating from WordPress or a CMS
  4. Cleaning up Notion exports
  5. Clipping web pages
  6. Reusing HTML email content
  7. Convert with FormatArc
  8. Step 1: Open the tool
  9. Step 2: Paste your HTML
  10. Step 3: Hit Run
  11. CLI and code alternatives
  12. Pandoc
  13. Turndown (JavaScript)
  14. Common issues and fixes
  15. Table conversion
  16. Style attribute removal
  17. Image paths
  18. Wrapping up

Converting HTML to Markdown comes up more often than you might expect. You are migrating WordPress posts to Hugo or Astro. You exported pages from Notion and the HTML is full of wrapper divs. You want to clip a web page into your notes without dragging along tags and inline styles. All of these end at the same step: turning HTML into clean Markdown.

This guide covers the main use cases, a browser-based conversion workflow, CLI alternatives, and common pitfalls.

Quick answer

Paste your HTML into HTML to Markdown and press Run. The Markdown appears instantly. Nothing to install, and the conversion runs entirely in the browser — your data never leaves your machine.

When the conversion comes up

Migrating from WordPress or a CMS

WordPress exports articles as HTML. Moving them to a static site generator like Hugo, Astro, or Jekyll means converting each post to Markdown. For a handful of posts you could do it by hand, but a conversion tool preserves structure without the tedium.

Cleaning up Notion exports

Notion supports HTML export, but the output is littered with Notion-specific class attributes and deeply nested div wrappers. Converting to Markdown strips the noise and leaves a readable text file you can drop into any Markdown-aware tool.

Clipping web pages

When you want to quote or save the content of a web page, copying raw HTML brings along tags and styles. Converting to Markdown keeps the structure — headings, lists, links — while discarding the presentation layer. This is also useful when feeding content to an LLM, since Markdown is more token-efficient than HTML.

Reusing HTML email content

Extracting the body of an HTML email into a document usually means stripping tags by hand. A converter preserves headings, lists, and links as Markdown while removing everything else.

Convert with FormatArc

HTML to Markdown takes pasted HTML and produces Markdown. There is nothing to install.

Step 1: Open the tool

Go to HTML to Markdown.

Step 2: Paste your HTML

Paste the HTML source into the left pane. The tool handles <table>, <ul>, <ol>, <a>, <img>, and the rest of the common tags.

Step 3: Hit Run

Press Run and the Markdown appears in the right pane.

HTML to Markdown conversion result

The conversion runs entirely in the browser. Internal documents and unpublished content stay on your machine.

CLI and code alternatives

Besides the browser tool, you can convert from the command line or inside a program.

Pandoc

pandoc -f html -t markdown -o output.md input.html

Requires a local install but handles batch conversions well. Use -t gfm if you want GitHub Flavored Markdown tables in the output.

Turndown (JavaScript)

import TurndownService from "turndown";

const turndown = new TurndownService();
const markdown = turndown.convert("<h1>Hello</h1><p>World</p>");
console.log(markdown);

The go-to library for Node.js projects. Plugins add support for tables, strikethrough, and other GFM features.

Common issues and fixes

Table conversion

HTML <table> elements are converted to Markdown pipe tables (| col |), but cells containing line breaks or nested lists cannot always be represented in Markdown's table syntax. Complex tables may need manual adjustment after conversion.

Style attribute removal

style and class attributes have no Markdown equivalent, so they are stripped during conversion. If you need the styling information, keep a copy of the original HTML.

Image paths

<img src="..."> becomes ![alt](src), but relative paths in the original HTML may not resolve in the destination environment. During a migration, copy the image files separately and update the paths.

Wrapping up

HTML-to-Markdown conversion is useful for CMS migration, web page clipping, export cleanup, and more. For quick one-off conversions, pasting into HTML to Markdown is the fastest path.

For the reverse direction — Markdown to HTML — see the Markdown to HTML guide. To turn CSV data into a Markdown table, check the CSV to Markdown guide.

Related tool

HTML to Markdown