Markdown cheat sheet
Every Markdown element with a copy-paste example. Edit the demo below to try any of them: it renders with the same engine as the editor, in your browser, with nothing uploaded.
Edit anything here and watch it render
Visual
Open the full editor
Runs in this tab, nothing is uploaded.
Quick reference
| Element | Syntax | Detail |
|---|---|---|
| Heading | # H1 ## H2 ### H3 | Full guide |
| Bold | **bold text** | Full guide |
| Italic | *italic text* | Full guide |
| Line break | end line with \ or two spaces | Full guide |
| Horizontal line | --- | Full guide |
| Link | [text](https://example.com) | Full guide |
| Link to a section | [Setup](#setup) | Full guide |
| Image |  | Full guide |
| Numbered list | 1. First
2. Second | Full guide |
| Bulleted list | - First
- Second | Full guide |
| Task list | - [x] Done
- [ ] Not done | Full guide |
| Nested list | - Parent
- Child | Full guide |
| Blockquote | > Quoted text | Full guide |
| Table | | A | B |
| --- | --- | | Full guide |
| Inline code | `code` | Full guide |
| Code block | ```js … ``` | Full guide |
| Strikethrough | ~~struck out~~ | Full guide |
| Comment | <!-- hidden --> | Full guide |
| Superscript | x<sup>2</sup> | Full guide |
| Escaping | \* literal asterisk | Full guide |
| Math | $E = mc^2$ | Full guide |
| Emoji | :rocket: | Full guide |
| Underline | <u>underlined</u> | Full guide |
| Center | <p align="center">…</p> | Full guide |
| Color | <font color="#0B7A53">…</font> | Full guide |
| Highlight | <mark>highlighted</mark> | Full guide |
| Collapsible | <details><summary>… | Full guide |
| Definition list | <dl><dt>Term</dt><dd>… | Full guide |
| Footnote | text[^1]
[^1]: the note | Full guide |
Element guides
- How to write headings in Markdown Markdown headings
- Markdown line breaks and new lines Markdown line break
- How indentation works in Markdown Markdown indent
- How to add a horizontal line in Markdown Markdown horizontal line
- How to add a hyperlink in Markdown Markdown hyperlink
- How to add a table of contents in Markdown Markdown table of contents
- How to make numbered and bulleted lists in Markdown Markdown numbered list
- How to write a definition list in Markdown Markdown definition list
- How to quote text in Markdown Markdown quote
- How to make a table in Markdown Markdown table
- How to bold and italicise text in Markdown Markdown bold
- How to underline text in Markdown Markdown underline
- How to change text color in Markdown Markdown text color
- How to center text in Markdown Markdown center text
- How to strike through text in Markdown Markdown strikethrough
- How to write superscript and subscript in Markdown Markdown superscript
- How to write code blocks in Markdown Markdown code block
- How to add an image in Markdown Markdown image
- How to use HTML inside Markdown HTML in Markdown
- How to cite sources in Markdown Markdown citation
- How to write a comment in Markdown Markdown comment
- How to escape characters in Markdown Markdown escape characters
- How to write math equations in Markdown Markdown math
- How to add emoji to Markdown Markdown emoji
Common questions
- Which Markdown flavour does this cheat sheet cover?
- GitHub Flavored Markdown, which is what GitHub, GitLab, Obsidian, Notion exports and most static site generators use. Tables, task lists and strikethrough are GFM extensions rather than original Markdown, and each is marked as such on its own page.
- Do I need to install anything to use Markdown?
- No. Markdown is plain text, so any text editor writes it. To see it formatted you need something that renders it: this site does that in your browser without an install or an account.
- What is the difference between Markdown and rich text?
- Markdown stores formatting as visible characters in a plain text file, so it stays readable, diffable and portable. Rich text stores formatting in a binary or XML wrapper that needs a specific application to open.
- Can I convert Markdown to Word or PDF?
- Yes, both, from the editor's Export menu, and both conversions run locally in your browser rather than on a server.
- Why does my formatting look different on another site?
- Flavours differ. Line-break handling is the most common divergence: GitHub comments turn every newline into a break, while standard Markdown joins consecutive lines into a paragraph.
Sources
- CommonMark: quick reference
- GitHub Flavored Markdown spectables, task lists, strikethrough
- GitHub Docs: basic writing and formatting syntax