cheat sheetsyntaxreference

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.

By mdkit Team··7 min read

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.

[Link text](https://example.com) [Link with title](https://example.com "Hover title") <https://example.com> — autolink <[email protected]> — autolink email
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

![Alt text](path/to/image.jpg) ![Alt text](image.jpg "Title shown on hover")

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.

[![Alt text](thumb.jpg)](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:

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.

ActionVS Code / ObsidianTypora
BoldCmd/Ctrl + BCmd/Ctrl + B
ItalicCmd/Ctrl + ICmd/Ctrl + I
LinkCmd/Ctrl + KCmd/Ctrl + K
CodeCmd/Ctrl + ECmd/Ctrl + Shift + `
Heading 1–6Cmd/Ctrl + 1–6Cmd/Ctrl + 1–6

Quick reference card

WhatHow
Heading# H1 to ###### H6
Bold**text**
Italic*text*
Strikethrough~~text~~
Link[text](url)
Image![alt](url)
Code (inline)`code`
Code block```lang```
Blockquote> text
Unordered list- item
Ordered list1. item
Task list- [ ] / - [x]
Table| col | col | + separator row
Horizontal rule---
Line breaktwo trailing spaces

Where to go next

Knowing the syntax is step one. Step two is actually writing good documentation. A few directions:

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?+
No. Markdown is a lightweight markup language — a plain-text format that converts to HTML. It has no logic, loops, or variables. You write it, a Markdown processor (like marked, commonmark, or GitHub's renderer) converts it to HTML for display.
What's the difference between CommonMark and GitHub Flavored Markdown?+
CommonMark is the standardized specification of Markdown's core syntax. GitHub Flavored Markdown (GFM) is CommonMark plus useful extensions: tables, task lists, strikethrough, autolinking URLs, and fenced code blocks with language hints. Most modern Markdown editors support GFM by default.
Do all Markdown editors support the same syntax?+
The core syntax (headings, lists, links, bold, italic, code) is universal. But extensions like tables, task lists, footnotes, and math (KaTeX/MathJax) vary. When in doubt, stick to CommonMark and test in your target environment.
How do I write a line break in Markdown?+
End a line with two spaces, then press Enter. Or insert a blank line between paragraphs. Some processors also accept a trailing backslash (\) for a forced break.
Can I use HTML inside Markdown?+
Yes. Most Markdown processors let you embed raw HTML (e.g., <kbd>, <details>, <sup>) for features Markdown doesn't have natively. Be aware that some platforms sanitize HTML for security — GitHub strips <script> and inline event handlers, for example.

Keep reading