Understanding Markdown
Markdown is a plain-text format for writing structured documents. It is easy to read even before it is rendered, which is why it is used for README files, documentation, notes apps, forums and many blogging tools. Sometimes, though, you need the HTML itself, for a CMS that only accepts HTML, an email template or a static page. This converter turns Markdown into clean HTML as you type, with a live preview so you can check the result.
Syntax cheat sheet
| Markdown | HTML |
|---|---|
# Heading 1 … ###### Heading 6 | <h1> … <h6> |
**bold** or __bold__ | <strong> |
*italic* or _italic_ | <em> |
~~strikethrough~~ | <del> |
`inline code` | <code> |
[text](https://example.com) | <a href="…"> |
 | <img> |
- item or * item | <ul><li> |
1. item | <ol><li> |
- [x] done | Task list checkbox |
> quote | <blockquote> |
--- on its own line | <hr> |
``` fenced code ``` | <pre><code> |
Paragraphs and line breaks
Separate paragraphs with a blank line. A single line break inside a paragraph is treated as a space, which matches how Markdown is rendered on GitHub and most other sites. To force a line break, end the line with two spaces or a backslash.
Lists
Start lines with -, * or + for a bulleted list, or with a number and a full stop for a numbered one. Indent a line to line up with the text of the item above to nest it. A numbered list that starts at a number other than 1 keeps its starting number.
Code
Wrap short snippets in backticks. For blocks, put three backticks on the line before and after the code. Add a language name after the opening backticks (for example ```js) and the converter adds a language-js class, which syntax highlighters such as Prism and highlight.js pick up.
Tables
Tables use the GitHub syntax: a header row, a divider row of dashes, then the data rows, with columns separated by |. Add colons to the divider to align a column: :--- for left, ---: for right and :---: for centre.
HTML and safety
Many Markdown processors let raw HTML pass straight through. This one escapes it instead, so a pasted <script> tag shows up as text rather than running. Links and images only accept http, https, mailto and relative URLs, so javascript: links are dropped. That makes the output safe to paste into a page, though you should still run untrusted content through your own sanitiser on the server.