How to use it
Type or paste Markdown on the left. The right-hand side shows a Preview of how it will look; switch to HTML to see the code and copy it. To go the other way, pick HTML → Markdown and paste HTML: you get clean Markdown, with a preview of how that Markdown renders. Swap takes the output, makes it the input and flips the direction, which is a quick way to tidy up messy HTML.
A worked example
This Markdown:
## Shopping
- [x] **Bread**
- [ ] Milk, see [the list](https://example.com/list)becomes this HTML:
<h2>Shopping</h2>
<ul>
<li><input checked="" disabled="" type="checkbox"> <strong>Bread</strong></li>
<li><input disabled="" type="checkbox"> Milk, see <a href="https://example.com/list">the list</a></li>
</ul>Markdown cheat sheet
| You type | You get |
|---|---|
# Heading, ## Smaller | Headings, levels 1 to 6 |
**bold**, *italic* | bold, italic |
[text](https://…) | A link |
 | An image |
- item or 1. item | Bulleted or numbered list |
- [ ] task, - [x] done | Task list (GitHub style) |
`code` | Inline code |
```js … ``` | Code block, labelled with its language |
> quote | Block quote |
--- | Horizontal rule |
~~old~~ | |
| a | b | then | --- | --- | | A table (GitHub style) |
In a table, colons in the line under the header set the alignment: :--- left, ---: right and :---: centred.
HTML to Markdown
Pasting HTML is useful for moving content out of a CMS, an email or a web page into a README, a wiki or a static site. The converter uses # headings, - bullets, fenced code blocks (keeping the language from a language- class) and GitHub-style tables. Pipes inside table cells are escaped so they don’t break the table. Tables are written with their first row as the header, because Markdown tables need one.
Characters that mean something in Markdown, like * or _ in ordinary text, are escaped with a backslash so they show up as written.
Why the preview is cleaned
Markdown lets you mix in raw HTML, and HTML can carry scripts. A preview that showed pasted HTML as it is could run that code on this page. So the preview is rebuilt from scratch from an allowlist: headings, paragraphs, lists, tables, links, images, code and a few more. Anything else is dropped or turned into plain text. Links only keep http, https, mailto, tel and relative addresses, and open in a new tab. The site’s security policy also stops images from other websites loading, so you’ll see an outline instead of the picture.
The HTML output is your converted text, shown but never run. If you publish HTML made from Markdown that other people wrote, clean it on your server too.
Common mistakes
- No blank line before a list or table. Many Markdown renderers need one, or the list is read as part of the paragraph above.
- Indenting with tabs and spaces mixed. Nested lists need consistent indentation, usually 2 or 4 spaces.
- Underscores in words.
snake_case_nameis safe in GitHub style, but some older renderers turn it italic. Put code in backticks. - Expecting styling to survive. HTML to Markdown keeps structure, not colours or fonts.
Checking a page’s HTML before it goes live? The meta tag checker previews its search result and share card. Comparing two versions of a document? Try the text diff. For links with odd characters, use URL encode and decode.
Questions people ask
Is the preview safe if I paste HTML from somewhere else?
onclick and javascript: links are all removed, and images from other websites aren’t loaded. The HTML output itself is shown as text, exactly as converted.What is GitHub Flavoured Markdown?
- [x]), strikethrough (~~text~~) and turns bare web addresses into links. Untick “GitHub style” to get plain CommonMark-style output instead.Does raw HTML in my Markdown come through?
Why do my line breaks disappear?
<br>, as GitHub comments do.