Markdown cheat sheet

Every Markdown element on one page: what to type, what you get, and a copy button. Basic syntax first, then GitHub Flavored Markdown extensions.

Try it in the editor

Basic syntax

Supported by every Markdown renderer since the 2004 original.

ElementMarkdownResult
HeadingGuide
# H1
## H2
### H3

H1

H2

H3

BoldGuide
**bold text**

bold text

ItalicGuide
*italic text*

italic text

Bold and italicGuide
***both***

both

Blockquote
> quoted text

quoted text

Ordered listGuide
1. First
2. Second
3. Third
  1. First
  2. Second
  3. Third
Unordered listGuide
- Item
- Item
  - Nested
  • Item
  • Item
    • Nested
Inline codeGuide
Run `npm test`

Run npm test

Horizontal rule
---

LinkGuide
[title](https://example.com)

title

ImageGuide
![alt text](https://github.githubassets.com/images/icons/emoji/octocat.png)

alt text

Line breakGuideEnd a line with \ or two spaces
line one\
line two

line one
line two

ParagraphSeparate with a blank line
First paragraph.

Second paragraph.

First paragraph.

Second paragraph.

Extended syntax

GitHub Flavored Markdown and common extensions. Works on GitHub, GitLab, most editors and static site generators.

ElementMarkdownResult
TableColons set alignment
| Syntax | Description |
| :----- | ----------: |
| Header | Title       |
| Cell   | Text        |
Syntax Description
Header Title
Cell Text
Fenced code blockGuide
```js
const x = 1
```
const x = 1
StrikethroughGuide
~~wrong~~

wrong

Task listGuide
- [x] Done
- [ ] To do
  • Done
  • To do
FootnoteGuide
A claim.[^1]

[^1]: The source.

A claim.[1]


  1. The source. ↩︎

Heading ID linkGuideHeadings get ids automatically
[Jump](#table)

Jump

AutolinkGuide
https://markdownforge.com

https://markdownforge.com

EmojiGuide
:rocket: :tada:

🚀 🎉

Reference linkGuide
[docs][1]

[1]: https://commonmark.org

docs

EscapingBackslash before any symbol
\*not italic\*

*not italic*

CommentGuide
<!-- hidden -->
Collapsible sectionHTML, works on GitHub
<details>
<summary>Click</summary>

Hidden **content**
</details>
Click

Hidden content

Keyboard key
<kbd>Ctrl</kbd> + <kbd>C</kbd>

Ctrl + C

UnderlineGuide
<ins>underlined</ins>

underlined

Mermaid diagramGitHub, GitLab, Obsidian
```mermaid
flowchart LR
  A --> B
```

GitHub, GitLab, Obsidian

GitHub-specific

Only rendered on github.com (issues, pull requests, READMEs).

ElementMarkdownResult
Note alertAlso TIP, IMPORTANT, WARNING, CAUTION
> [!NOTE]
> Useful information.

Also TIP, IMPORTANT, WARNING, CAUTION

MentionNotifies the user
@username

Notifies the user

Issue referenceLinks issue or PR 123
#123

Links issue or PR 123

MathLaTeX between $ signs
$E = mc^2$

LaTeX between $ signs

Color hintShows a swatch in issues
`#ff6600`

Shows a swatch in issues

Markdown in 60 seconds

Markdown is plain text with a few symbols that mean “format this”. You write **important**, a renderer turns it into important. The rules above cover about 99% of what you’ll ever need. The two rules people trip over most:

  • Blank lines matter. A blank line separates paragraphs, lists, tables and code blocks. Without it, blocks merge. See line breaks.
  • Spaces after symbols matter. #Heading and -item are plain text; # Heading and - item are not.

Flavours of Markdown

CommonMark is the strict, unambiguous specification most tools now follow. GitHub Flavored Markdown (GFM) is CommonMark plus tables, task lists, strikethrough and autolinks, and is what GitHub, and this site, use. Others, like MultiMarkdown, Pandoc Markdown and MDX, add their own extras. If something here doesn’t work in your app, it is almost always an extended feature the app doesn’t support.

New to all this? Read what Markdown is and how it works, or browse the syntax guides.

Questions people ask

What is the basic Markdown syntax?
Headings with #, bold with **, italic with *, lists with - or 1., links with [text](url), images with ![alt](url), code with backticks and quotes with >. The first table on this page covers it all.
What is the difference between basic and extended syntax?
Basic syntax is what John Gruber’s original Markdown defined and every renderer supports. Extended syntax (tables, fenced code, task lists, strikethrough, footnotes) was added by flavours like GitHub Flavored Markdown and is supported almost everywhere today, but not universally.
Is there a printable Markdown cheat sheet?
Yes. Press “Print / save PDF” and this page prints as a compact two-page reference without the site’s navigation.
Which syntax works on GitHub?
All of the basic and extended syntax here, plus the GitHub-only items in the last table: alerts, mentions, issue references and math.