Markdown Editor
Write Markdown with a live side-by-side preview. Supports GitHub Flavored Markdown tables and task lists, sanitized HTML output and .md/.html download.
Rendered with marked and sanitized with DOMPurify: scripts, event handlers and other unsafe HTML are removed from the preview and the HTML output.
Related Tools
View AllWhat is Markdown Editor?
An online Markdown editor with a live preview next to the text. It supports GitHub Flavored Markdown (tables, task lists, strikethrough, autolinks), shows the generated HTML, and lets you copy the HTML or download the document as .md or a standalone .html file.
How to use Markdown Editor
- Write or paste Markdown in the editor, or press Load sample to see the syntax.
- Watch the preview update as you type; switch the view between side by side, editor, preview and HTML.
- Toggle GitHub Flavored Markdown and Treat single line breaks as <br> as needed.
- Copy the HTML or use Download .md / Download .html.
Example
# Hi **bold** and <img src=x onerror=alert(1)>
<h1>Hi</h1> <p><strong>bold</strong> and <img src="x"></p>
The onerror handler is removed by DOMPurify
When to use Markdown Editor
Use it to draft README files, documentation, notes, forum posts or e-mails written in Markdown, or to convert Markdown into clean HTML. Syntax that is specific to one platform (GitHub alerts, Mermaid diagrams, math with $…$, wiki links) is not rendered.
How Markdown Editor works
The Markdown is converted with the marked library (CommonMark-compatible, with GFM extensions when enabled; the breaks option turns single newlines into <br>). The resulting HTML is passed through DOMPurify with its HTML profile, which removes <script>, event-handler attributes such as onerror, javascript: URLs and other dangerous markup before it is shown in the preview, copied or downloaded. Both libraries are loaded on demand in your browser.
Common Use Cases
- Drafting a README.md with live preview
- Converting Markdown notes into HTML for a website or e-mail
- Writing tables and task lists in GFM
- Teaching or learning Markdown syntax
- Previewing Markdown from a CMS or chat before posting
Security Note
Preview and HTML output are sanitised with DOMPurify, so pasting untrusted Markdown cannot run scripts on this page. The Markdown never leaves your browser.
FAQs
Is raw HTML in Markdown allowed?
Yes, but it is sanitised: safe tags remain, while scripts, event handlers and javascript: links are removed.
Is my document saved?
No. Nothing is stored or uploaded – download the .md file to keep your work.
What is GitHub Flavored Markdown?
GitHub's extension of CommonMark that adds tables, task lists (- [x]), strikethrough (~~text~~) and automatic links.