HTML to Markdown Converter

Convert HTML markup to clean Markdown syntax instantly in your browser. Powered by turndown.js — your HTML is never uploaded to a server.

Converting HTML to Markdown

This tool uses turndown.js (v7.1.2), a lightweight JavaScript library that converts HTML to Markdown. turndown.js maps standard HTML elements to their Markdown equivalents: <h1><h6> become heading symbols, <strong> becomes **double asterisks**, <em> becomes *single asterisks*, <ul>/<li> become hyphen-prefixed list items, and <a> becomes [text](url) link syntax.

ATX vs Setext Headings

ATX headings use hash symbols at the start of the line (# H1, ## H2). They support all six heading levels and are the most widely supported Markdown heading syntax. Setext headings underline the heading text with equals signs (H1\n===) or dashes (H2\n---). They only support two heading levels (H1 and H2) and are less common in modern Markdown documents. ATX is recommended for new documents.

Common Use Cases

Frequently Asked Questions

turndown.js converts: headings (h1–h6), paragraphs (p), bold (strong/b), italic (em/i), strikethrough (del/s), inline code (code), code blocks (pre), unordered lists (ul/li), ordered lists (ol/li), links (a), images (img), blockquotes (blockquote), and horizontal rules (hr). Tables are supported via the turndown-plugin-gfm plugin. Elements without Markdown equivalents (div, span, form, etc.) have their tags removed but their text content is preserved.

No. turndown.js runs entirely in your browser as a JavaScript library. Your HTML input is processed locally and the Markdown output is generated client-side. Nothing is transmitted to any server, making this tool safe for proprietary or sensitive HTML content.

Use the league/html-to-markdown Composer package: composer require league/html-to-markdown. Then: $converter = new League\HTMLToMarkdown\HtmlConverter(); $markdown = $converter->convert($html);. This PHP library is functionally similar to turndown.js and supports the same set of HTML elements.