← Home

Markdown Syntax Cheatsheet

Complete Markdown reference with syntax examples and rendered results. Covers CommonMark, GitHub Flavored Markdown, and extended syntax.

Headings

# Heading 1Largest heading (h1)
## Heading 2Second-level heading (h2)
### Heading 3Third-level heading (h3)
#### Heading 4Fourth-level heading (h4)
##### Heading 5Fifth-level heading (h5)
###### Heading 6Smallest heading (h6)
Heading 1\n=========Alternative h1 using underline with = signs
Heading 2\n---------Alternative h2 using underline with - signs

Text Formatting

**bold text**Bold text
__bold text__Bold text (alternative)
*italic text*Italic text
_italic text_Italic text (alternative)
***bold and italic***Bold and italic text
~~strikethrough~~Strikethrough text
`inline code`Inline code with monospace font
==highlighted text==Highlighted / marked text
**nested _formatting_**Bold with nested italic
H~2~OSubscript text (renders as H₂O)
X^2^Superscript text (renders as X²)

Links & Images

[Link Text](https://example.com)Inline hyperlink
[Link Text](https://example.com "Title")Link with hover title attribute
<https://example.com>Auto-linked URL
<email@example.com>Auto-linked email address
[Link Text][ref]\n\n[ref]: https://example.comReference-style link (defined elsewhere)
[ref]: https://example.com "Optional Title"Reference link definition with title
![Alt text](image.jpg)Inline image
![Alt text](image.jpg "Image title")Image with title attribute
[![Alt](img.jpg)](https://example.com)Clickable image link
![Alt text][img-ref]\n\n[img-ref]: image.jpgReference-style image

Lists

- Item one\n- Item two\n- Item threeUnordered list with dashes
* Item one\n* Item twoUnordered list with asterisks
+ Item one\n+ Item twoUnordered list with plus signs
1. First\n2. Second\n3. ThirdOrdered (numbered) list
1. First\n1. Second\n1. ThirdAuto-numbered ordered list (all use 1.)
- Parent\n - Child\n - GrandchildNested list (indent 2-4 spaces)
1. Ordered\n - Mixed\n - NestingMixed ordered and unordered nesting
- [x] Completed task\n- [ ] Incomplete taskTask list with checkboxes
- [ ] Todo item\n- [x] Done item\n- [ ] Another todoTask list / checklist

Code

`const x = 42;`Inline code span
``code with `backtick` inside``Inline code containing backticks (use double backticks)
```\ncode block\n```Fenced code block (triple backticks)
```javascript\nconsole.log('hi');\n```Code block with JavaScript syntax highlighting
```python\ndef hello():\n print('hi')\n```Code block with Python syntax highlighting
```bash\nnpm install\n```Code block with Bash/shell syntax highlighting
```json\n{ "key": "value" }\n```Code block with JSON syntax highlighting
indented code line\n another lineIndented code block (4 spaces or 1 tab)
```diff\n+ added line\n- removed line\n```Diff code block showing additions/removals

Blockquotes & Horizontal Rules

> This is a blockquoteSingle-line blockquote
> Line one\n> Line two\n> Line threeMulti-line blockquote
> Outer quote\n>> Nested quoteNested blockquote (double >)
> **Note:** Important infoBlockquote with formatted text inside
> > > Triple nestedDeeply nested blockquote
---Horizontal rule (three dashes)
***Horizontal rule (three asterisks)
___Horizontal rule (three underscores)

Tables

| Header | Header |\n| ------ | ------ |\n| Cell | Cell |Basic table with headers
| Left | Center | Right |\n| :--- | :----: | ----: |\n| A | B | C |Table with column alignment
:--- (left align)Left-align column (default)
:---: (center align)Center-align column
---: (right align)Right-align column
| Name | Age |\n| - | - |\n| Alice | 30 |\n| Bob | 25 |Minimal separator (single dash works)
| Escaped \| Pipe | Normal |Escaped pipe character inside cells
| `code` | **bold** | *italic* |Formatted text inside table cells

Extended Syntax

Text with footnote[^1]\n\n[^1]: Footnote contentFootnote reference and definition
[^longnote]: Multi-paragraph footnoteNamed footnote reference
Term\n: Definition of the termDefinition list
First Term\n: First definition\n: Second definitionTerm with multiple definitions
:emoji_name:Emoji shortcode (e.g., :smile: :rocket: :heart:)
H~2~OSubscript (renders as H₂O)
X^2^Superscript (renders as X²)
*[HTML]: Hyper Text Markup LanguageAbbreviation (hover to see full form)
\*literal asterisks\*Escaped characters (backslash prevents formatting)
<!-- comment -->HTML comment (hidden in rendered output)

Frequently Asked Questions

What is the difference between Markdown and HTML?

Markdown is a lightweight markup language that converts to HTML. It uses simple symbols like # for headings and ** for bold, while HTML uses tags like <h1> and <strong>. Most Markdown renderers also support inline HTML for cases where Markdown syntax is insufficient.

Which Markdown features are universally supported?

Core features like headings, bold, italic, links, images, lists, code blocks, and blockquotes are supported everywhere (CommonMark spec). Extended features like tables, task lists, footnotes, and strikethrough depend on the renderer — GitHub Flavored Markdown (GFM) supports most of them.

How do I create a line break in Markdown?

End a line with two or more spaces followed by Enter for a soft break (<br>). Leave a blank line between paragraphs for a paragraph break. Some renderers also support a trailing backslash \ for line breaks.

Can I use Markdown in GitHub, Notion, and Slack?

Yes, but each platform has slight differences. GitHub uses GFM with full table and task list support. Notion supports most Markdown on paste and via shortcuts. Slack uses a limited subset — bold, italic, strikethrough, code, and links — with slightly different syntax for some features.

Related Resources