Your input stays in this browser.
Your result will appear here.
Enable JavaScript in your browser to use this tool.
Code examples Starting points for your own code. Run them in the environment shown below.
Copy codeLanguage · exampleJavaScript · Render sanitized HTML Python · Convert to HTML Use current inputs
Browser · ES module with a bundler (Vite)
Current inputs apply only to fields used by the example. Selected files are not embedded.
Install dependencies
npm install marked dompurifyimport { marked } from "marked";
import DOMPurify from "dompurify";
const markdown = "# Hello tools\n\n**Markdown** preview.";
const html = DOMPurify.sanitize(marked.parse(markdown), {
FORBID_TAGS: ["img", "iframe"],
});
const preview = document.createElement("article");
preview.innerHTML = html;
document.body.append(preview);
Put it to work Preview as you type and export HTML.
Details that matter Format and meaning HTML is sanitized. Scripts, remote images, and iframes do not run or load in the preview.
Supported scope and limits Text 1 MB
Split inputs that exceed the limit. If a format or algorithm is unsupported, choose a tool that matches your requirements instead of silently changing the format.