PUBLIC.INTERNET

Markdown to HTML Converter (Clean Output)

Paste Markdown and get HTML you can drop into a CMS, a static page or an email template. The parser is marked 18 with GitHub Flavored Markdown on, and it passes 644 of the 652 examples in the CommonMark 0.31.2 spec; the tests pin the 8 misses. Every result goes through DOMPurify with a fixed allowlist, so the HTML you copy or download is the same sanitized markup the preview shows. Conversion happens in this page, and nothing you type is sent anywhere unless you turn on Load images in preview, which fetches the image URLs in your Markdown.

Sanitized: raw HTML is kept only for allowlisted tags and attributes, and links only for http, https, ftp, mailto, tel and relative URLs. Scripts, styles, iframes, forms, SVG and event handlers are removed.

Preview

The preview runs no scripts and fetches nothing unless you turn on images. Links in it do not open.

How to Convert Markdown to HTML

  1. Paste or type Markdown in Markdown input. Sample loads release notes with a table, a task list and a code block; Clear empties everything.
  2. Choose how single line breaks render. Off, a line break inside a paragraph stays a newline, as CommonMark and GitHub READMEs do. Turn on Line breaks as <br> to match GitHub comments.
  3. Check the preview. It is a sandboxed frame styled with the site theme. Turn on Load images in preview to fetch remote images; the HTML output is the same either way.
  4. Copy HTML puts the output on the clipboard. Download .html saves a full document whose title and file name come from the first level 1 heading.

What the Sanitizer Keeps and Why

Markdown allows raw HTML. CommonMark passes tags such as <img onerror> or <script> straight through, and a link like [x](javascript:alert(1)) is valid syntax. So converting someone else's Markdown without sanitizing hands their script to your page. This tool keeps text formatting, tables, lists, images, <details>, <kbd> and similar tags, and removes scripts, styles, iframes, forms, SVG, MathML, event handlers, id and style attributes.

Links are checked by scheme. An href or src survives only when it is http, https, ftp, mailto, tel or a relative URL. Tabs, newlines and entities hidden inside javascript: do not get past, because the check runs on the decoded value with whitespace stripped. data: URLs are removed too, including base64 images, so host those images as files.

Where the output differs from the spec. The parser alone matches 644 of the 652 CommonMark 0.31.2 examples. Of the 8 misses, 4 are bare URLs and email addresses that become links, as GitHub does, 3 keep accented letters in a URL unencoded, and 1 fenced code block in a list loses a trailing blank line. After sanitizing, 598 match. Besides those 8, 1 link title loses its leading and trailing newlines, 4 are autolinks with a scheme such as made-up-scheme:, which lose their link, and 41 contain raw HTML: 24 lose a tag, attribute or comment outside the allowlist, and 17 change only because the sanitizer rebuilds the markup, closing open tags and adding <tbody> to tables.