Markdown Previewer
Type Markdown on the left and see the rendered HTML on the right, updated as you type. Headings, bold, italic, strikethrough, inline code, fenced code blocks, links, images, bare-URL autolinks, bullet, numbered and task lists, blockquotes, horizontal rules and pipe tables with column alignment are supported. Raw HTML is shown as text rather than rendered, so pasting a README from somewhere else cannot run scripts on this page, and nothing you type leaves your browser.
How to use the Markdown Previewer
- Type or paste Markdown into the left pane. The preview refreshes about a tenth of a second after you stop typing.
- Click Load example for a sample that uses headings, a JavaScript code block, a list with a link, task items, a table and a blockquote.
- Click Copy HTML to put the rendered HTML on your clipboard, for pasting into a CMS or an HTML email.
Blocks are separated the way Markdown expects: a blank line ends a paragraph, a line starting with # plus a space
is a heading, - , * or + starts a bullet item, 1. or 1) a numbered item,
> a quote, and ``` opens and closes a code block. A line ending in two spaces inside a paragraph
becomes a hard line break (<br>). A numbered list that starts at another number keeps it:
3. x followed by 4. y renders as <ol start="3">.
Supported syntax and the HTML it produces
| Markdown | HTML output |
|---|---|
# Hi *there* | <h1>Hi <em>there</em></h1> |
Use `<b>` and **bold** | <p>Use <code><b></code> and <strong>bold</strong></p> |
~~old~~ new | <p><del>old</del> new</p> |
See https://example.com/a. | <p>See <a href="https://example.com/a">https://example.com/a</a>.</p> (the final full stop stays outside the link) |
- [x] Done- [ ] Todo | <ul><li><input type="checkbox" checked disabled> Done</li><li><input type="checkbox" disabled> Todo</li></ul> |
```js … ``` | <pre><code class="language-js">…</code></pre>, the class most syntax highlighters (Prism, highlight.js) look for |
Tables use the GitHub pipe syntax. The separator row sets column alignment: :-- left, --: right and
:-: center. A missing cell renders as an empty cell, and \| puts a literal pipe inside a cell. For example
| a | b |
|:--|--:|
| 1 | |
renders a two-column table whose first column is left-aligned and whose second column is right-aligned, with an empty second cell in the body row.
Emphasis markers need a non-space character just inside them, as in CommonMark, so arithmetic such as
2 * 3 * 4 stays literal instead of turning into italics. Link URLs may contain one level of parentheses, so
[Foo](https://en.wikipedia.org/wiki/Foo_(bar)) links to the full Wikipedia address.
Common use cases
- README and documentation drafts. Check how headings, code blocks and tables will look before you push to GitHub or GitLab.
- Issue, pull-request and forum posts. Preview a long bug report with code and task lists before you post it.
- Markdown to HTML for a CMS or newsletter. Write in Markdown, then use Copy HTML for an editor that only accepts HTML.
- Checking Markdown produced by an LLM. Model output is usually Markdown; paste it here to read it formatted, without letting any HTML it contains run.
What is escaped, and why
GitHub's renderer allows some raw HTML inside Markdown. This previewer does not: every character you type is HTML-escaped
before formatting is applied. Pasting <img src=x onerror=alert(1)> produces
<p><img src=x onerror=alert(1)></p>: the tag is displayed as text and its error handler never runs.
Link and image addresses are limited to http:, https:, mailto: and relative URLs.
Any other scheme becomes #, so [x](javascript:alert(1)) renders as <a href="#">x</a> and a
data: image renders with src="#". The check ignores letter case, so JavaScript: is caught as well.
Limits of this parser
- It is a compact line-based parser, not a full CommonMark or GFM implementation.
- Nested lists render flat: an indented
- itembecomes another item of the same list. - Underscore emphasis (
_x_,__x__), reference-style links ([text][id]), footnotes, heading IDs and raw HTML are not supported. - A paragraph line with two or more
|characters ends the paragraph, because it may start a table. - No syntax highlighting: the fence language only becomes a
language-*class.