Markdown ↔ HTML converter

Two-way Markdown/HTML conversion with a sandboxed live preview; paste rich text and get clean Markdown back.

Markdown is fast to write, but publishing to the web, email or a CMS needs HTML; copying from a web page into your notes, README or docs site needs Markdown. Both directions come up constantly, and pasting content into a random online converter means trusting someone else with the text.

This tool converts both ways: Markdown renders live through marked (GFM tables, task lists and fenced code included), with the HTML side switchable between rendered preview and source — the preview runs in a sandboxed iframe where scripts can never execute. The reverse direction uses turndown to produce clean Markdown (ATX headings, fenced blocks). Switching direction carries the output back into the input, so one round trip shows you exactly how faithful the conversion is.

Why the preview lives in an iframe

Writing <script> or <img onerror> inside Markdown is perfectly legal input — a converter must translate it faithfully, but must never execute it in the page. The preview therefore runs in a sandbox="" iframe: scripts, forms and popups are all disabled, only static markup renders. Trying HTML from an untrusted source is safe.

The trade-offs of HTML → Markdown

HTML is a superset of Markdown: spans, nested tables and custom attributes have no faithful Markdown form. The reverse conversion prioritizes structure — headings, lists, links, images, emphasis, code blocks, quotes and simple tables are kept, presentation-only markup is dropped. For Word or web pastes, check the output before using it.

Frequently asked questions

Is the conversion local?
Yes. marked and turndown are bundled into the page and run in your browser — no network requests, pasted documents never leave the machine.
Which Markdown extensions are supported?
GFM: tables, task lists, strikethrough, autolinks, fenced code blocks with language tags. Extensions outside GFM (footnotes, math) are not guaranteed and render as plain text.
Why did some styling disappear after converting from HTML?
Anything Markdown cannot express (exact colors, fonts, complex layouts) is dropped — that is a limit of the format, not the tool. Keep HTML where fidelity matters; for Markdown, restructure the key content with headings, lists and tables.

Related tools