Guides for Markdown Editor and Reader
Markdown cheat sheet: all syntax at a glance
Markdown turns plain text into formatted documents with a handful of characters. This cheat sheet lists the syntax in two groups: the core that every CommonMark-compatible renderer understands, and the extensions from GitHub Flavored Markdown (GFM) that most modern editors support as well.
If a piece of syntax does not render in your app, check which group it belongs to first. Tables, task lists and strikethrough are not part of CommonMark itself.
CommonMark: the core syntax
Headings need a space after the hash signs: # Title is a heading, #Title is not. Use asterisks for emphasis inside a word: un*frigging*believable is italic in the middle, while underscores inside words such as snake_case_name are left alone.
| Element | Syntax | Alternative |
|---|---|---|
| Heading 1 to 6 | # Heading | ###### Heading |
| Bold | **bold** | __bold__ |
| Italic | *italic* | _italic_ |
| Bold and italic | ***bold italic*** | ___bold italic___ |
| Inline code | `code` – one backtick on each side | use two backticks if the code contains one |
| Link | [text](https://example.com) | [text](https://example.com "Title") |
| Reference link | [text][1] | [1]: https://example.com |
| Image |  |  |
| Autolink | <https://example.com> | – |
| Blockquote | > Quote | >> nested quote |
| Bulleted list | - Item | * Item |
| Numbered list | 1. Item | 1) Item |
| Horizontal rule | --- | *** |
| Hard line break | two spaces at the end of the line | a backslash at the end of the line |
| Escape a character | \*not italic\* | works for all ASCII punctuation |
| Indented code block | indent every line by four spaces | prefer fenced code blocks |
GitHub Flavored Markdown extensions
GFM is a superset of CommonMark. GitHub, many static site generators and most Markdown editors support these extensions. Footnotes work on GitHub and in many editors, but they are not part of the GFM specification, so support varies.
| Element | Syntax | Note |
|---|---|---|
| Table | | A | B | | header row, then a row like | --- | --- | |
| Task list | - [ ] open | - [x] done |
| Strikethrough | ~~text~~ | GFM also accepts a single tilde |
| Bare URL autolink | www.example.com | https://example.com |
| Footnote (GitHub, not in the GFM spec) | Text[^1] | [^1]: The note. |
Code blocks
For multi-line code, put three backticks on their own line before and after the code. The word after the opening backticks is the language; many renderers use it for syntax highlighting. Three tildes (~~~) work the same way.
```python
def greet(name):
return f"Hello, {name}"
```Nested lists and task lists
A nested item must be indented to where the text of its parent item starts: two spaces under - Item, three under 1. Item. The numbers in an ordered list do not have to be sequential; the renderer counts from the first number.
- Fruit
- Apple
- Pear
1. First step
1. Sub-step
- [x] Write the draft
- [ ] ProofreadAlternative headings
CommonMark also accepts “setext” headings, underlined with equals signs or hyphens. They only cover levels 1 and 2.
Heading 1
=========
Heading 2
---------Common pitfalls
- --- directly below a line of text turns that line into a heading. Leave a blank line above a horizontal rule.
- A single line break inside a paragraph is rendered as a space. End the line with two spaces or a backslash, or leave a blank line to start a new paragraph.
- Leave a blank line between blocks such as paragraphs, lists, tables and code blocks. It is always valid and avoids surprises in stricter renderers.
- Raw HTML is allowed by CommonMark, but many apps and sites filter it for security reasons.
- To show a literal *, _, # or [ , put a backslash in front of it.
Seeing the result as you write
Markdown Editor highlights headings, bold, italic, code, links, lists and quotes as you type, and its formatting bar above the keyboard inserts headings, lists, checklists, links, code, quotes, tables and images with one tap. A tap on the eye opens the preview with tables, checklists, nested lists, code blocks and images; on iPad, text and preview sit side by side. With Markdown Editor Pro you can export a document as formatted PDF or HTML.
Frequently asked questions
How do I make text bold and italic in Markdown?
Use **bold** for bold, *italic* for italic and ***text*** for both. Underscores (__bold__, _italic_) work as well, but not inside words.
What is the difference between CommonMark and GitHub Flavored Markdown?
CommonMark is a precise specification of the core Markdown syntax. GitHub Flavored Markdown builds on it and adds tables, task lists, strikethrough and autolinks for bare URLs.
How do I start a new line without a new paragraph?
End the line with two spaces or with a backslash. A plain line break is rendered as a space, and a blank line starts a new paragraph.