Markdown Preview
Preview Markdown as HTML.
About this tool
Type or paste Markdown and watch it render next to the editor, with no button to press. Headings, lists, tables, task lists, quotes and fenced code blocks all show up as they will on GitHub-style pages. The preview is sanitized, so a pasted script tag or javascript: link cannot run. You can copy or download the HTML too.
How to use
How it works
The Markdown is converted to HTML with the marked parser using GitHub-flavoured rules. Before anything is shown, the HTML goes through the DOMPurify sanitizer with a strict allow-list: only ordinary content tags such as headings, paragraphs, lists, tables, links, images and code survive. Script, style, iframe, form and SVG elements are removed with their contents, every on* event attribute and style attribute is dropped, and link and image addresses must be http, https, mailto or relative (images may also be small inline PNG, JPEG, GIF or WebP data). Links open in a new tab with rel=noopener noreferrer nofollow, and task-list checkboxes are read-only.
Worked example
Unsafe HTML inside Markdown
- Input
- # Hi **bold** and <script>alert(1)</script> [x](javascript:alert(1))
- Output
- <h1>Hi</h1> <p><strong>bold</strong> and <a>x</a></p>
- Walkthrough
- The heading and bold text render normally. The script element is removed entirely, and the link keeps its text but loses the javascript: address.
Limitations
- Raw HTML you type is filtered, so styled or embedded content (iframes, videos, inline CSS) will not appear in the preview.
- Remote images are fetched from their own servers when the preview shows them.
- Math, diagrams and footnotes are not rendered; only standard and GitHub-flavoured Markdown is.
- The copied HTML is the sanitized version, not a byte-for-byte copy of what a different Markdown renderer would produce.
Questions
Does the preview update while I type?
Is it safe to paste Markdown from someone else?
Does it support tables and task lists?
Can I get the HTML out?
Is my text uploaded?
Features
- Live side-by-side preview
- Tables and task lists
- Sanitized output
- Copy or download HTML
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn Regular Expressions - Crash Course
freeCodeCamp.org
Regex primer for tester and explainer pages.
Watch on YouTubeWhat Is A RESTful API?
Traversy Media
API context for JWT, JSON, and encoding utilities.
Watch on YouTube
- Base64
MDN
When Base64 is appropriate versus raw binary transfer.
- Regular expressions
MDN
JS regex guide aligned with browser-based testers.