🔒 All processing happens in your browser. No data is sent to any server.
FREE

HTML to Markdown Converter

← All Tools
HTML Input
Markdown Output

What is HTML to Markdown Converter?

HTML to Markdown Converter transforms HTML markup into Markdown syntax. Paste HTML from any source — a web page, a rich text editor, a CMS, or raw HTML code — to get clean Markdown output: headings (h1→#, h2→##), bold (**text**), italic (*text*), links ([text](url)), images (![alt](url)), code blocks (```), tables, and unordered/ordered lists. It handles nested HTML and cleans up excess whitespace.

Markdown is a lightweight markup language that converts to HTML. It's used in: GitHub READMEs and wikis, Obsidian and other note-taking apps, documentation generators (Docusaurus, MkDocs), blog platforms (Ghost, Hashnode), Jira/Confluence/Notion (with Markdown support), and API documentation. Converting HTML to Markdown is useful when migrating content between CMS platforms, extracting article text from web pages, or creating documentation from HTML output.

Not all HTML has clean Markdown equivalents: tables convert well (standard Markdown table syntax). Nested lists convert with indentation. Inline styles (color, font-size) are dropped in conversion. iframes, forms, and canvas don't have Markdown equivalents and are omitted. For complex HTML with heavy styling, the converter outputs clean semantic Markdown while dropping presentation-only markup.

How to Use

  1. Paste HTML code or a web page's source into the left input panel.
  2. The Markdown output appears in real time in the right panel.
  3. Toggle 'Clean whitespace' to remove excess blank lines from the output.
  4. Adjust 'Link style': inline links ([text](url)) or reference-style links ([text][1]).
  5. Click 'Copy Markdown' to copy the output and paste it into your Markdown editor.

Examples

Convert article from CMS

Result:

Title

Bold and italic text

→ # Title / **Bold** and *italic* text

Convert table

Result:

NameAge
Alice30
→ | Name | Age |\n|------|-----|\n| Alice | 30 |

Convert code block

Result:

const x = 1;
→ ```js\nconst x = 1;\n```

Frequently Asked Questions

Which HTML elements have direct Markdown equivalents?

Direct equivalents: h1-h6 → # through ######, strong/b → **, em/i → *, a → [text](url), img → ![alt](url), code → `inline`, pre → ``` block, ul/li → - list item, ol/li → 1. list item, blockquote → > quote, hr → ---, br → double space or \. No direct equivalents: div, span, table (supported in GFM but not all parsers), form, iframe, button, style, script.

What is GFM (GitHub Flavored Markdown)?

GFM is GitHub's Markdown extension adding: tables (|col|col|), task lists (- [x] done), strikethrough (~~text~~), fenced code blocks with syntax highlighting (```js), and URL autolinking. Most modern Markdown platforms support GFM or a superset of it. Standard Markdown (John Gruber's original) is a smaller subset. This converter outputs GFM-compatible Markdown.

Why does my converted Markdown look wrong in some apps?

Markdown parsers differ: CommonMark (the standard), GFM (GitHub), Pandoc, and others have different rules for edge cases (nested lists, code blocks inside lists, HTML-in-Markdown). Obsidian uses a strict CommonMark parser. Notion uses its own Markdown variant. If conversion looks wrong: (1) Check if the target app supports tables (not all parsers do). (2) Check nested list indentation (4 spaces vs 2 vs tab). (3) Raw HTML may be passed through or stripped depending on the parser.

How do I convert a web page's HTML to Markdown?

Method 1 — this tool: paste the page's HTML source (View Source → copy all). Method 2 — browser extensions: 'Copy as Markdown', 'MarkDownload', or 'Obsidian Web Clipper'. Method 3 — CLI: pandoc -f html -t markdown page.html > output.md (handles complex HTML including inline styles and tables better than most web converters). Method 4 — Python: markdownify library: from markdownify import markdownify; md = markdownify(html_string).

What is the difference between Markdown and MDX?

MDX is Markdown with JSX support — you can embed React components inline with your content. A .mdx file can contain standard Markdown plus: import statements, React component usage (), and JSX expressions. MDX is used in Next.js, Gatsby, and Docusaurus for documentation with interactive components. Standard Markdown tools can't process .mdx files — you need an MDX compiler (@mdx-js/mdx).

Related Tools