Markdown Editor — Live Preview, GFM Tables, Copy HTML
Write Markdown on the left and see a live preview on the right. Tables, fenced code, lists, and strikethrough follow GitHub Flavored Markdown. The preview HTML is sanitized with DOMPurify before it is rendered or copied. Nothing is uploaded.
What is Markdown?
Markdown is a lightweight markup language that turns plain text into HTML using a small set of conventions for headings, lists, links, code, and tables. GitHub Flavored Markdown (GFM) extends the original syntax with tables, strikethrough, autolinks, and fenced code blocks — the dialect used in README files and pull requests. See: GitHub Flavored Markdown Spec.
Why Use This Tool
- README files — Draft GitHub README content and check tables before you commit.
- Technical docs — Preview headings, lists, and fenced code as you write.
- Copy HTML — Copy sanitized HTML for emails, CMS fields, or static pages. HTML Viewer →
- Compare revisions — Diff two Markdown drafts after you preview them. String Diff →
Tips
- Put a blank line before a GFM table so it is not parsed as a paragraph.
- Fenced code uses three backticks and an optional language tag.
- Copy HTML after you are happy with the preview — it is already sanitized.
- Diff two Markdown drafts with String Diff when you need a revision check.
How to Use the Markdown Editor
Write or paste Markdown
Type in the editor or load the sample. GFM tables use pipes and a header separator row.
Watch the live preview
The right pane updates as you type. HTML is sanitized with DOMPurify before it is shown.
Switch to HTML if you need the markup
HTML view shows the same sanitized output you can copy.
Copy HTML
Copy the sanitized HTML to the clipboard. Nothing is stored or uploaded.
Worked Examples
Heading and emphasis
# Title Hello **world**.
<h1>Title</h1> <p>Hello <strong>world</strong>.</p>
GFM table
| Name | Role | | ---- | ---- | | Ada | Engineer |
<table> <thead> <tr> <th>Name</th> <th>Role</th> </tr> </thead> <tbody><tr> <td>Ada</td> <td>Engineer</td> </tr> </tbody></table>
A header row, a separator row of dashes, then body rows. Alignment colons are optional.
Fenced code
```js const n = 1; ```
<pre><code class="language-js">const n = 1; </code></pre>
Common Errors & How to Fix Them
| Error Message | Cause | Fix |
|---|---|---|
Table renders as a paragraph | Missing separator row or no blank line before the table | Use a header row, a line of dashes, then body rows. Put a blank line before the table. |
Preview is empty after load | The pane waits until the client mounts so sanitization can use the DOM | Keep JavaScript enabled. The sample preview appears after the page hydrates. |
Script or iframe disappeared | Raw HTML in Markdown is sanitized | That is expected. DOMPurify strips script, iframe, and event handlers before preview and copy. |
Markdown vs HTML
| Feature | Markdown | HTML |
|---|---|---|
| Authoring | Plain text shortcuts | Explicit tags |
| Tables | GFM pipe tables | <table> markup |
| Preview | Converted then sanitized | Rendered as written |
| Best for | README and docs | Full pages and email |
Frequently Asked Questions
Does this Markdown editor upload my text?
No. Parsing, sanitizing, preview, and copy all run in your browser. There is no account and no server round-trip.
Are GitHub Flavored Markdown tables supported?
Yes. Pipe tables with a header separator row render as HTML <table> elements. Alignment colons work as in GitHub.
How is the preview sanitized?
Markdown is converted to HTML, then DOMPurify strips script, iframe, object, embed, and event-handler attributes. Copy HTML uses that same sanitized string.
Can I copy HTML from Markdown?
Yes. Click Copy HTML, or switch to the HTML view to inspect the markup first. The clipboard receives the sanitized preview HTML, not the Markdown source.
Is raw HTML in Markdown executed?
No. GFM allows some raw HTML through the parser, but the preview never injects unsanitized markup. Scripts and javascript: URLs are removed.
How is this different from the HTML Viewer?
The HTML Viewer runs full HTML, CSS, and JavaScript in a sandboxed iframe. This tool is for Markdown: GFM tables, a reading preview, and copyable sanitized HTML. Use the HTML Viewer when you need a page sandbox.