The Complete Markdown Cheat Sheet (2026)
Every Markdown syntax you'll ever need, in one reference: headings, lists, tables, code blocks, links, images, task lists, and GitHub extensions. Print-friendly and bookmark-ready.
Markdown is the default writing format for GitHub READMEs, static site generators, documentation tools, chat apps, and most technical blogs. If you can memorize 20 symbols, you can write documentation, blog posts, and project notes faster than in any rich-text editor.
This cheat sheet covers every Markdown syntax you're likely to need, organized from most to least used. Bookmark it, print it, or copy sections into your own docs.
Headings
# H1 — Page title ## H2 — Major section ### H3 — Sub-section #### H4 — Deeper ##### H5 ###### H6
Best practice: use only one H1 per document (the title), then H2 for major sections. Avoid skipping levels (H2 → H4) — it breaks screen-reader navigation and SEO heuristics.
An alternative "Setext" style exists for H1 and H2 but it's rarely used:
Page Title ========== Section -------
Emphasis
*italic* or _italic_ **bold** or __bold__ ***bold italic*** ~~strikethrough~~ (GFM) ==highlight== (extension — not universal)
Renders as: italic, bold, bold italic, strikethrough.
Lists
Unordered
- First item - Second item - Nested (2 spaces) - Another nested - Third item
You can use -, *, or + interchangeably. Pick one and stick to it for consistency.
Ordered
1. First 2. Second 3. Third
The actual numbers don't matter — Markdown renumbers automatically:
1. First 1. Second 1. Third
This still outputs 1. 2. 3.. Useful when reordering items so you don't have to renumber manually.
Task lists (GFM)
- [x] Completed task - [ ] Pending task - [ ] Another todo
Widely supported on GitHub, GitLab, Obsidian, Notion, and most modern editors.
Links
[Link text](https://example.com) [Link with title](https://example.com "Hover title") <https://example.com> — autolink <[email protected]> — autolink email
Reference-style links (great for long documents)
See [mdkit blog][1] and [the cheat sheet][cheatsheet] for more. [1]: https://mdkit.io/blog [cheatsheet]: https://mdkit.io/blog/markdown-cheat-sheet
Images
 
Reference-style also works:
![Alt][logo] [logo]: /images/logo.png
Always write meaningful alt text. It's what screen readers announce and what Google uses for image SEO.
Image with link
[](https://example.com)
Code
Inline code
Use `code` for inline snippets, file names like `README.md`, or short identifiers.
Fenced code blocks with language
```javascript const greet = (name) => `Hello, ${name}!`; ``` ```python def greet(name): return f"Hello, {name}!" ``` ```bash npm install mdkit ```
The language tag enables syntax highlighting in GitHub, static site generators, and most Markdown viewers.
Indented code blocks (legacy)
Prefix with four spaces:
No language highlighting here. Just plain monospace.
Fenced blocks are strongly preferred.
Blockquotes
> A single-line quote. > A multi-line > blockquote just works. > **With formatting** inside quotes. > > Even multiple paragraphs.
Nested quotes
> Outer quote > > > Inner quote > > Back to outer
Tables (GFM)
| Name | Role | Price | | :------ | :--------: | ----: | | Alice | Admin | $200 | | Bob | Editor | $50 | | Charlie | Viewer | $10 |
Alignment is set by the colons in the separator row:
:---→ left:---:→ center---:→ right
Tips: you don't need to align the pipes manually; most editors do it for you. Need a no-typing-required table? Try the Markdown Table Generator.
Horizontal rule
---
Three or more hyphens, asterisks, or underscores on their own line. Use sparingly — usually an H2 is a better section break.
Escaping special characters
Prefix with a backslash:
\*not italic\* \# not a heading \`not code\`
Escapable characters: \ ` * _ {} [] () # + - . ! |.
Line breaks
- Paragraph break: one blank line between paragraphs.
- Soft break: end a line with two spaces, then newline.
- Hard break:
<br>(HTML) works everywhere.
HTML inside Markdown
Markdown passes HTML through by default:
<kbd>Ctrl</kbd> + <kbd>C</kbd> to copy. <details> <summary>Click to expand</summary> Hidden content goes here. </details> <sub>subscript</sub> and <sup>superscript</sup>
Some platforms (like GitHub comments) sanitize dangerous tags. Always test.
GFM extensions
GitHub Flavored Markdown adds these on top of CommonMark:
Autolinks
URLs become clickable automatically:
Visit https://mdkit.io — no brackets needed.
Task lists
(Covered above.)
Strikethrough
~~This is struck out.~~
Tables
(Covered above.)
Fenced code blocks with language hints
(Covered above.)
Footnotes (Pandoc / some processors)
Here's a claim that needs a source.[^1] [^1]: Source details here.
Not universal — check your renderer.
Math (KaTeX / MathJax — extension)
Inline: $E = mc^2$ Block: $$ \sum_{i=1}^{n} i = \frac{n(n+1)}{2} $$
Supported by GitHub, Obsidian, many static site generators. Not part of CommonMark.
Diagrams (Mermaid — extension)
```mermaid graph TD A[Start] --> B[Write Markdown] B --> C{Valid?} C -->|Yes| D[Ship it] C -->|No| B ```
Supported by GitHub, GitLab, Notion, Obsidian.
Comments
Markdown has no native comment syntax. Use HTML:
<!-- This won't render. Useful for editor notes. -->
Front matter (YAML)
Used by static site generators (Hugo, Jekyll, Next.js MDX, Astro):
--- title: "My Post" date: "2026-02-04" tags: ["markdown", "guide"] --- Post content starts here.
The --- fences delimit the metadata block. Most renderers strip it before display.
Keyboard shortcuts in popular editors
| Action | VS Code / Obsidian | Typora |
|---|---|---|
| Bold | Cmd/Ctrl + B | Cmd/Ctrl + B |
| Italic | Cmd/Ctrl + I | Cmd/Ctrl + I |
| Link | Cmd/Ctrl + K | Cmd/Ctrl + K |
| Code | Cmd/Ctrl + E | Cmd/Ctrl + Shift + ` |
| Heading 1–6 | Cmd/Ctrl + 1–6 | Cmd/Ctrl + 1–6 |
Quick reference card
| What | How |
|---|---|
| Heading | # H1 to ###### H6 |
| Bold | **text** |
| Italic | *text* |
| Strikethrough | ~~text~~ |
| Link | [text](url) |
| Image |  |
| Code (inline) | `code` |
| Code block | ```lang … ``` |
| Blockquote | > text |
| Unordered list | - item |
| Ordered list | 1. item |
| Task list | - [ ] / - [x] |
| Table | | col | col | + separator row |
| Horizontal rule | --- |
| Line break | two trailing spaces |
Where to go next
Knowing the syntax is step one. Step two is actually writing good documentation. A few directions:
- Try it live in our browser-based Markdown editor with GFM, syntax highlighting, and preview.
- Convert existing HTML with the HTML to Markdown tool when migrating content.
- Export to PDF with Markdown to PDF for shareable reports.
- Learn GFM in depth in GitHub Flavored Markdown Explained.
- Write a proper README with our README template and dedicated guide.
Markdown is one of those skills where two hours of focused learning saves you hundreds of hours over a career. You now have the reference. Start writing.
Frequently Asked Questions
Is Markdown a programming language?+
What's the difference between CommonMark and GitHub Flavored Markdown?+
Do all Markdown editors support the same syntax?+
How do I write a line break in Markdown?+
Can I use HTML inside Markdown?+
Keep reading
GitHub Flavored Markdown (GFM) Explained
What GitHub Flavored Markdown adds on top of standard Markdown: tables, task lists, autolinks, strikethrough, emoji, and platform-specific features. With examples you can use today.
Markdown vs. HTML: When to Use Which (2026)
A practical comparison of Markdown and HTML — performance, flexibility, portability, and when each is the right tool. With real examples and decision rules.
Markdown Tables: Syntax, Alignment, and Generators
A complete guide to Markdown tables: GFM syntax, column alignment, escaping pipes, nested content, and when to reach for HTML instead. With copy-paste examples.