Paste Markdown and convert it to clean HTML instantly, with a live rendered preview and an optional sanitize toggle. Copy the HTML or download it as a .html file.
Markdown is written and read comfortably as plain text, but almost every destination that ultimately displays it — a web page, an email client, a CMS field — needs actual HTML, not raw Markdown syntax. Converting Markdown to HTML is the step that bridges this gap: it takes the lightweight, readable source you wrote and produces the fully-formed markup a browser or rich-text renderer expects, turning `# Heading` into `<h1>Heading</h1>`, `**bold**` into `<strong>bold</strong>`, and so on for every supported syntax element.
This tool uses marked, a widely-used, actively maintained JavaScript Markdown parser, configured with GitHub Flavored Markdown (GFM) extensions and automatic line-break conversion. As you type, your Markdown source is tokenized into a structured representation of headings, paragraphs, lists, code blocks, and inline formatting, then converted into standard HTML entirely synchronously, in your browser. The resulting HTML is shown directly in the HTML tab and rendered live in the Preview tab, so you can inspect both the raw markup and its visual result side by side.
When Sanitize output is enabled, the generated HTML is parsed using the browser's own built-in HTML parser (via DOMParser), producing a real, structured document you can inspect and modify programmatically rather than treating the HTML as an opaque string. The sanitizer then removes a fixed list of script-capable elements (`<script>`, `<style>`, `<iframe>`, `<object>`, `<embed>`, `<link>`, `<meta>`, `<base>`) entirely, strips every attribute whose name starts with 'on' (the pattern used by all inline event handlers, like `onclick` or `onerror`), and removes any `href` or `src` attribute that uses a `javascript:` URL scheme — a classic way to smuggle executable code into an otherwise-inert-looking link or image tag. This targeted, DOM-based approach is more reliable than trying to catch dangerous patterns with regular expressions alone, since it operates on the actual parsed element structure rather than pattern-matching raw text.
Markdown was deliberately designed to allow raw HTML wherever Markdown's own syntax doesn't cover a specific need — this is a documented, intentional part of the original Markdown specification, not a bug or an oversight. This flexibility is genuinely useful for legitimate cases (embedding a video, adding a specific HTML attribute Markdown has no syntax for) but it also means that Markdown from an untrusted or unreviewed source can carry arbitrary HTML straight through to your output, including tags and attributes capable of running JavaScript. Since you can't always be certain a piece of Markdown text is free of anything unwanted just by skimming it, sanitization provides a cheap, automatic safeguard for the common case of converting Markdown you didn't personally write from scratch.
A typical real-world workflow: write or receive content in Markdown (a README, a blog draft, documentation notes), convert it to HTML here, review the rendered Preview to confirm formatting looks right, then paste the HTML into its final destination — a CMS, an email template, a static page. For content you're fully confident in, sanitization has no visible effect and can safely stay on by default; for content pulled from an external contributor, a scraped source, or anywhere you haven't personally verified every line, sanitization is a useful default safeguard specifically because it costs nothing for well-behaved Markdown while quietly protecting you from anything unexpected.
Markdown to HTML handles converting Markdown source into HTML markup. These related tools cover the reverse conversion and other nearby formats.