Text & Code

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.

Markdown366 chars
Preview—
Preparing preview…

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

1

Write or paste Markdown

Type in the editor or load the sample. GFM tables use pipes and a header separator row.

2

Watch the live preview

The right pane updates as you type. HTML is sanitized with DOMPurify before it is shown.

3

Switch to HTML if you need the markup

HTML view shows the same sanitized output you can copy.

4

Copy HTML

Copy the sanitized HTML to the clipboard. Nothing is stored or uploaded.

Worked Examples

Heading and emphasis

Input
# Title

Hello **world**.
→
Output
<h1>Title</h1>
<p>Hello <strong>world</strong>.</p>

GFM table

Input
| Name | Role |
| ---- | ---- |
| Ada | Engineer |
→
Output
<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

Input
```js
const n = 1;
```
→
Output
<pre><code class="language-js">const n = 1;
</code></pre>

Common Errors & How to Fix Them

Error MessageCauseFix
Table renders as a paragraphMissing separator row or no blank line before the tableUse a header row, a line of dashes, then body rows. Put a blank line before the table.
Preview is empty after loadThe pane waits until the client mounts so sanitization can use the DOMKeep JavaScript enabled. The sample preview appears after the page hydrates.
Script or iframe disappearedRaw HTML in Markdown is sanitizedThat is expected. DOMPurify strips script, iframe, and event handlers before preview and copy.

Markdown vs HTML

FeatureMarkdownHTML
AuthoringPlain text shortcutsExplicit tags
TablesGFM pipe tables<table> markup
PreviewConverted then sanitizedRendered as written
Best forREADME and docsFull 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.