Markdown Syntax Cheat Sheet

A quick-reference cheat sheet for everyday Markdown, based on CommonMark plus GitHub's GFM extensions.

Headings

# Heading 1            # top-level heading
## Heading 2           # second-level heading
### Heading 3          # third-level heading
#### Heading 4         # fourth-level heading
##### Heading 5        # fifth-level heading
###### Heading 6       # smallest heading
Title                  # setext-style H1 (=== underneath)
===
Section                # setext-style H2 (--- underneath)
---

Emphasis

*italic*               # italic with asterisks
_italic_               # italic with underscores
**bold**               # bold with asterisks
__bold__               # bold with underscores
***bold italic***      # bold + italic combined
~~deleted~~            # strikethrough (GFM)
`inline code`          # inline code with backticks

Lists

- item                 # unordered list with dash
* item                 # unordered list with asterisk
+ item                 # unordered list with plus
1. First               # ordered list
2. Second              # ordered list
3. Third               # custom start number is honored
1. one                 # renders as 1., 2. — auto-renumbered
1. two
  - Nested item        # nested list (2-space indent)
    - Deeper nesting   # 4-space indent

Links and Images

[link text](https://example.com)              # inline link
[link text](https://example.com "Title")      # link with hover title
[link text][ref]                              # reference-style link
[ref]: https://example.com                    # reference definition (place anywhere)
<https://example.com>                         # autolink with angle brackets
https://example.com                           # bare URL auto-links (GFM)
<me@example.com>                              # autolinked email address
[Jump to Headings](#headings)                 # anchor link to a heading on this page
![alt text](photo.png)                        # image
![alt text](photo.png "Caption")              # image with hover title
[![alt](photo.png)](https://example.com)      # clickable image

Code Blocks

```python                 # fenced block with syntax highlighting
print("Hello")
```                      # closing fence
```js
console.log("hi");
```
~~~                      # tilde fences work too
code here
~~~
    indented code        # 4-space indented code block
``code with `tick` inside``  # double backticks when code contains one

Tables

| Name | Age |        # header row
| ---- | --- |        # delimiter row (hyphens required)
| Ada  | 36  |        # data row
| Bo   | 28  |        # data row
| :--- | :---: | ---: |  # left / center / right column alignment

Task Lists

- [x] Done task        # checked checkbox (GFM)
- [ ] Todo task        # unchecked checkbox (GFM)

Blockquotes

> Quoted text          # blockquote
> > Nested quote       # nested blockquote
> First paragraph
>
> Second paragraph     # blank ">" line separates paragraphs
> - Quoted list item   # list inside a quote
> `code` in quote      # inline formatting works in quotes

Horizontal Rules

---                    # horizontal rule (blank lines needed around it)
***                    # same, with asterisks
___                    # same, with underscores

Escaping

\*not italic*           # literal asterisk, not emphasis
\# not a heading       # literal hash, not a heading
\[not a link]          # literal bracket, not a link
\`code\`               # literal backticks, not code
\\                     # literal backslash
&amp;                  # HTML entity renders as &

Extras

Text with footnote[^1]  # footnote marker (rendered on GitHub)
[^1]: Footnote text.    # footnote definition
<!-- hidden note -->    # HTML comment, never rendered
Line one                # two trailing spaces → hard line break
Line one\               # trailing backslash → hard line break
First<br>Second         # HTML break tag also works
<kbd>Ctrl</kbd> + <kbd>C</kbd>  # raw inline HTML is allowed