Markdown to HTML Converter
Convert Markdown to clean HTML instantly in your browser. Supports headings, lists, tables, task lists, fenced code, and math formulas as MathML or KaTeX ? sanitized by default.
All processing on this page runs locally in your browser unless noted otherwise.
Markdown input
Markdown to HTML
Convert Markdown to clean, safe HTML ? locally in your browser.
Features
- Headings, lists and links
- Tables, task lists and fenced
code - Inline math
and display math:
Also works with brackets:
| Output | Description |
|---|---|
| Fragment | Body HTML only |
| Document | Full page with optional CSS |
| MathML | Native browser math markup |
| KaTeX | Styled HTML formulas |
Diagram (Mermaid)
flowchart LR A[Paste Markdown] --> B[Preview] B --> C[Export]
Nothing you paste is uploaded.
console.log('Nothing is uploaded')
How to use
- Paste Markdown, import a
.mdfile, or bring it from the Editor / Clean Markdown tools. - Choose fragment for embedding, or document for a full page.
- Use the right-pane tabs to switch between HTML output and Live preview.
- Pick MathML (self-contained, native) or KaTeX (styled HTML) for
$...$/$$...$$formulas. - Mermaid diagrams use
```mermaidfences; Live preview renders them, and Copy / Download bake diagrams in as SVG. - Copy the HTML or download a
.htmlfile ? nothing is uploaded.
FAQ
Is the HTML safe?
Yes. Raw HTML inside Markdown is disabled, and the output is sanitized to strip scripts and event handlers. MathML tags and KaTeX markup are allowlisted when formulas are enabled.
HTML output vs Live preview?
HTML output shows the generated markup (including full documents when selected). Live preview renders a sanitized fragment so you can check formulas and layout before copying.
MathML vs KaTeX?
MathML is a W3C format browsers render without extra CSS — ideal for embedding and accessibility. KaTeX emits HTML/CSS for consistent look across browsers; complete documents include a KaTeX stylesheet link.
Fragment vs document?
A fragment is the converted body markup only. A document wraps it in a doctype, charset, title and optional stylesheet that respects light/dark preference.
Do Mermaid diagrams work in downloaded HTML?
Yes. Copy and Download convert mermaid fences to inline SVG first, so a complete HTML document opens with diagrams visible offline — no Mermaid script required.
Does conversion leave my device?
No. Markdown to HTML (including KaTeX) runs entirely in your browser.