← Back to Guides
How-ToThe Complete Markdown Cheatsheet
Published on 2026-02-22

The Complete Markdown Cheatsheet

A comprehensive reference for every Markdown syntax element — headings, links, tables, code blocks, and more — with live examples.

This cheatsheet covers both CommonMark (the universal standard) and GitHub Flavored Markdown (GFM) extensions, which are both fully supported in this editor.

Headings

markdown
# H1 — Page Title
## H2 — Section
### H3 — Sub-section
#### H4 — Detail
##### H5 — Fine Detail
###### H6 — Smallest

Text Formatting

Syntax Result
**bold** or __bold__ bold
*italic* or _italic_ italic
***bold italic*** bold italic
~~strikethrough~~ strikethrough
`inline code` inline code

Paragraphs and Line Breaks

Separate paragraphs with a blank line. For a hard line break within a paragraph, end the line with two spaces or a backslash \.

Blockquotes

markdown
> This is a blockquote.
>
> It can span multiple paragraphs.

> Nested:
>> Second level quote.

Lists

Unordered Lists

markdown
- Item A
- Item B
  - Nested item
  - Another nested item
- Item C

Ordered Lists

markdown
1. First
2. Second
   1. Sub-item
   2. Sub-item
3. Third

Task Lists (GFM)

markdown
- [x] Completed task
- [ ] Pending task
- [ ] Another pending task
markdown
[Link text](https://example.com)
[Link with title](https://example.com "Hover tooltip")
<https://auto-linked-url.com>

[Reference-style link][ref]
[ref]: https://example.com

Images

markdown
![Alt text](https://example.com/image.png)
![Alt text](./local-image.png "Optional title")

Code

Inline Code

markdown
Use `console.log()` to debug.

Fenced Code Blocks

markdown
```python
def greet(name):
    return f"Hello, {name}!"
```

Supported language identifiers include python, javascript, typescript, bash, sql, json, yaml, html, css, and dozens more.

Tables (GFM)

markdown
| Column A | Column B | Column C |
|----------|:--------:|---------:|
| Left     | Center   | Right    |
| aligned  | aligned  | aligned  |

Colons in the separator row control alignment: left (default), :---: center, ---: right.

Horizontal Rule

markdown
---
***
___

HTML

Raw HTML is supported and passes through unchanged:

markdown
<div style="color: red;">
  This is <strong>HTML</strong> inside Markdown.
</div>

Footnotes

markdown
Here is a claim that needs a citation.[^1]

[^1]: The source of this claim is *Journal of Examples*, 2024.

Math (KaTeX)

Inline math: $E = mc^2$

Block math:

markdown
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$

Diagrams

Embed live diagrams using fenced code blocks with the diagram type as the language:

markdown
```mermaid
graph LR
  A --> B --> C
```

Supported: mermaid, plantuml, graphviz, d2, vega-lite, katex, and more.

Escaping Characters

Prefix any special character with a backslash to render it literally:

markdown
\*Not italic\*
\# Not a heading
\[Not a link\]

Quick Reference Card

Element Syntax
Heading # H1 ## H2 ### H3
Bold **text**
Italic *text*
Strikethrough ~~text~~
Code `code`
Link [text](url)
Image ![alt](url)
Blockquote > text
Unordered list - item
Ordered list 1. item
Horizontal rule ---
Table | col | col |
Task list - [x] done
Footnote [^1]
Math (inline) $formula$
Math (block) $$formula$$