Markdown Preview
Write Markdown and see the rendered result side-by-side. GitHub-flavored syntax, sanitized output, copy HTML. Never leaves your browser.
Use this free Markdown preview to render GitHub-flavored Markdown side-by-side with the source. The HTML is sanitized with DOMPurify before display, so the output is safe to paste straight into your CMS or email. Everything runs locally — your text never leaves your device.
How to use it
No account, no upload — it all happens on your device.
Markdown quick reference
The handful of marks you'll use 90% of the time.
| You write | You get |
|---|---|
| # Heading 1 | <h1>Heading 1</h1> |
| ## Heading 2 | <h2>Heading 2</h2> |
| **bold** | <strong>bold</strong> |
| *italic* or _italic_ | <em>italic</em> |
| `inline code` | inline code in a monospace span |
| [link](https://x.com) | Inline link to x.com |
|  | Inline image with alt text |
| - item 1\n- item 2 | Bullet list |
| 1. step 1\n2. step 2 | Numbered list |
| > quote | Blockquote |
| ```ts\ncode\n``` | Fenced code block |
| | a | b |\n|---|---|\n| 1 | 2 | | Table |
| --- | Horizontal rule |
| - [ ] todo\n- [x] done | GFM task list |
Why DOMPurify matters
Markdown lets you embed raw HTML — including scripts.
Most Markdown parsers, including marked, let you mix raw HTML into your document. That's a feature for trusted authors and a vulnerability for anyone else: a <script> tag in pasted Markdown would otherwise execute when previewed.
This tool runs the parsed HTML through DOMPurify, which strips <script>, <style>, event-handler attributes (onclick, onerror), and other vectors before showing or copying anything. The output is safe to paste into a CMS, an email, or a help-doc system.
If you do need raw "trusted" HTML in your output, don't bypass the sanitizer — use the dedicated CMS or static site generator that knows about your trust model.
GFM vs CommonMark
Markdown comes in flavors. CommonMark is the underlying spec. GitHub-Flavored Markdown (GFM) adds:
- Tables (the
| col | col |syntax) - Task lists (
- [ ]and- [x]) - Autolinks (URLs in plain text become clickable)
- Strikethrough (
~~text~~) - Fenced code blocks with language hints
This previewer renders all of the above. If you're writing for a site that doesn't support GFM, plain CommonMark is a safe subset — skip tables and task lists.