env.dev

Markdown Cheat Sheet — Syntax Quick Reference

Markdown syntax quick reference: headings, links, images, lists, code blocks, tables, and GitHub Flavored Markdown extensions.

By env.dev Updated

A quick reference for Markdown syntax. Covers headings, emphasis, links, images, lists, code, tables, blockquotes, and extended syntax.

Headings

SyntaxResult
# Heading 1Top-level heading (H1)
## Heading 2Section heading (H2)
### Heading 3Subsection heading (H3)
#### Heading 4Sub-subsection heading (H4)
##### Heading 5Minor heading (H5)
###### Heading 6Smallest heading (H6)

Emphasis & Formatting

SyntaxResult
*italic* or _italic_Italic text
**bold** or __bold__Bold text
***bold italic***Bold and italic text
~~strikethrough~~Strikethrough text
`inline code`Inline code
==highlighted==Highlighted text (some parsers)
H~2~OSubscript (some parsers)
X^2^Superscript (some parsers)

Links & Images

SyntaxDescription
[text](url)Inline link
[text](url "title")Link with hover title
[text][ref]Reference-style link
[ref]: urlReference link definition
![alt](image.png)Inline image
![alt](image.png "title")Image with title
<https://example.com>Auto-linked URL
<user@example.com>Auto-linked email

Lists

SyntaxDescription
- itemUnordered list (also * or +)
1. itemOrdered list
- nestedNested list (indent 2 spaces)
- [x] doneChecked task list item
- [ ] todoUnchecked task list item
1. First\n 1. Sub-itemNested ordered list

Code Blocks

SyntaxDescription
`code`Inline code span
```\ncode\n```Fenced code block
```js\ncode\n```Code block with syntax highlighting
indented codeIndented code block (4 spaces)
```diff\n+added\n-removed\n```Diff syntax highlighting
```json\n{"key": "value"}\n```JSON code block

Tables

SyntaxDescription
| H1 | H2 |Table header row
| --- | --- |Separator row (required)
| cell | cell |Table data row
| :--- |Left-aligned column
| :---: |Center-aligned column
| ---: |Right-aligned column

Blockquotes & Rules

SyntaxDescription
> quoteBlockquote
> line1\n> line2Multi-line blockquote
>> nestedNested blockquote
---Horizontal rule (also *** or ___)
\Escape special characters

Extended Syntax

SyntaxDescription
[^1]Footnote reference
[^1]: TextFootnote definition
term\n: definitionDefinition list (some parsers)
:emoji_name:Emoji shortcode (GitHub, etc.)
[[toc]]Table of contents (some parsers)
$$math$$Math block (LaTeX, some parsers)

Common gotchas

  • A hard line break needs two trailing spaces (or a backslash in some parsers). A single newline is collapsed into the same paragraph.
  • A list or fenced code block needs a blank line before it; without one, many parsers fold it into the preceding paragraph.
  • GFM tables require the | --- | separator row — omit it and the pipes render as literal text.
  • Markdown is not one standard: CommonMark, GFM, and others differ on nested lists, autolinks, and the ~~/== extensions. Anything marked "some parsers" above is not portable.
  • Indentation is load-bearing: nested items need 2-space (or content-aligned) indentation, and 4-space-indented text silently becomes a code block.

Most of this shows up first in a project README — pair it with the Git cheat sheet.

Was this helpful?

Frequently Asked Questions

What is the difference between Markdown and HTML?

Markdown is a lightweight markup language that converts to HTML. It is easier to read and write than raw HTML. Most Markdown renderers allow inline HTML for features Markdown does not support.

What is GitHub Flavored Markdown (GFM)?

GFM extends standard Markdown with tables, task lists, strikethrough, auto-linking URLs, and fenced code blocks with syntax highlighting. It is used in GitHub issues, PRs, and README files.

How do I create a table in Markdown?

Use pipes (|) and hyphens (-): | Header | Header |\n| --- | --- |\n| Cell | Cell |. Use colons for alignment: :--- (left), :---: (center), ---: (right).