Markdown ↔ HTML Converter

Convert Markdown to sanitized HTML and HTML back to Markdown, safely.

Loading tool…

How to use it

  1. Paste Markdown and press "Markdown → HTML" (or the reverse with HTML input).
  2. The generated HTML is sanitized with DOMPurify: scripts, event handlers and dangerous URLs are removed.
  3. Check the preview — it renders the sanitized output only, so it can never execute code.
  4. Copy the result; unsupported tags in HTML→Markdown mode are flattened to plain text.

About this tool

Markdown is parsed with a battle-tested parser and the resulting HTML is sanitized to remove scripts and event handlers before any preview is shown, protecting you from XSS embedded in pasted content. The reverse direction converts clean HTML back to Markdown with configurable options.

Your input never leaves the browser: this tool works entirely offline once the page has loaded.

Frequently asked questions

Is the generated HTML safe to publish?

Yes: the output is sanitized with DOMPurify and then checked against a blocklist (scripts, iframes, event handlers, javascript: URLs). If anything unsafe survives, the tool shows an error instead of rendering it.

Which Markdown flavor is supported?

GitHub-flavored Markdown (tables, strikethrough, task lists) via the marked parser, the same flavor used by most developer platforms.