Markdown to HTML Converter with a Sanitised Live Preview

Convert Markdown to HTML with GFM tables and task lists, heading ids and a full-page option. Safe sanitised preview plus raw HTML to copy or download.

Runs in your browser. Nothing is uploaded.

Converters

Markdown to HTML

Markdown

Max 50MB each

Files are read in your browser and never uploaded. Up to 50 MB, UTF-8 text.

Preview (sanitised)

Paste Markdown on the left, or load the sample. The rendered page appears here.

The preview is cleaned with DOMPurify: scripts, event handlers, forms, styles and remote images are removed. The HTML below is exactly what marked produced, with nothing removed. Sanitise untrusted Markdown yourself before you publish it.

Result

The raw HTML appears here, ready to copy or download.

Example

Input
# Notes

- [x] Done
- **Bold** and `code`

| a | b |
|---|---|
| 1 | 2 |
Result
<h1 id="notes">Notes</h1>
<ul>
<li><input checked="" disabled="" type="checkbox"> Done</li>
<li><strong>Bold</strong> and <code>code</code></li>
</ul>
<table>...</table>

What you get

Type or paste Markdown, drop a .md file, or load the sample. The tool shows two things: a rendered preview and the raw HTML source, which you can copy or download as an .html file. Conversion uses the marked library with GitHub Flavored Markdown switched on by default, which adds tables, task lists, strikethrough and automatic links. Turn GFM off for plain CommonMark-style behaviour, and turn on the line break option if a single newline inside a paragraph should become a <br>.

Heading ids are generated from the heading text (lowercase, hyphenated, unique, with letters of any alphabet kept), so links like #release-notes work, and duplicates become same, same-1 and so on. The full-document option wraps the result in a complete page with a doctype, a charset, a viewport tag, a title taken from your first heading and a short stylesheet, so you can save and open it directly.

Preview versus output: read this before publishing

Markdown allows raw HTML, and marked passes it through unchanged. That means a <script> tag, an onerror attribute or a javascript: link in your Markdown ends up in the HTML output exactly as written. The HTML panel shows precisely what marked produced and the download is that text, nothing removed. The preview is different: it is cleaned with DOMPurify using a strict allow-list that removes scripts, event handlers, forms, styles, iframes and data attributes, allows only http, https, mailto, tel and in-page links, and never loads remote images, replacing them with their alt text so the preview makes no network requests.

When the Markdown contains active content the tool warns you. If the Markdown comes from users or an untrusted source, you must sanitise the resulting HTML yourself before publishing it, on the server with a maintained sanitiser, ideally together with a Content Security Policy. A sanitised preview here does not make the downloaded HTML safe.

Limits

Markdown has several dialects and extensions. This tool covers CommonMark plus GFM; it does not process front matter, footnotes, math, diagrams or custom containers, and it does not highlight code blocks, it only adds the language class that highlighters use. Inputs above about a megabyte are converted in a background worker, and the preview is switched off for very large results so the page stays fast. Nothing is uploaded: conversion and sanitising both run in your browser.

Frequently asked questions

Is the HTML output sanitised?

No. The output is exactly what marked produced, including any raw HTML in the Markdown. Only the on-page preview is sanitised. Sanitise untrusted Markdown yourself before publishing.

What does GFM add?

Tables, task lists, strikethrough with double tildes and automatic links for plain URLs. Turn it off for stricter base Markdown.

Why do images not show in the preview?

The preview never loads remote resources, so it shows the alt text instead. Your HTML output keeps the image tags unchanged.

Can I get a complete HTML page?

Yes. Turn on "Full HTML document" for a doctype, head, title from your first heading and a small stylesheet, then download the file.

Are my notes uploaded?

No. Conversion and preview run in your browser.

Related tools