This markdown cheat sheet covers every syntax element you will encounter in 2026, from basic headings and bold text to GFM tables, task lists, footnotes, and math blocks. Every example is copy-paste ready. If you have ever wondered what those hash marks, asterisks, or pipe characters mean when you paste output from an AI tool, this is the reference that will answer every question.
Markdown was created by John Gruber in 2004 as a way to write formatted text using plain characters. The core idea has not changed: you type simple symbols, and they convert to rich formatting. But the ecosystem has expanded significantly. Today there is a baseline (CommonMark), a popular extension set (GitHub Flavored Markdown, or GFM), and tool-specific additions for math, diagrams, and more.
This cheat sheet is organized from basic to advanced. Bookmark it.
The markdown cheat sheet: text formatting
Text formatting is the most common markdown syntax. These work in every markdown processor.
Bold and italic
**This text is bold**
__This also works for bold__
*This text is italic*
_This also works for italic_
***This text is bold and italic***
___This also works___
~~This text has a strikethrough~~
Rendered result:
- This text is bold
- This text is italic
- This text is bold and italic
This text has a strikethrough
Strikethrough (~~text~~) is technically a GFM extension, but virtually every modern markdown processor supports it.
Highlight, superscript, and subscript
These are extended syntax elements. Not all processors support them.
==This text is highlighted==
This has a ^superscript^ word
This has a ~subscript~ word
Support: Highlight (==text==) works in Obsidian, Unmarkdown™, and several other tools. Superscript and subscript use ^text^ and ~text~ respectively in some processors, but support varies. When in doubt, check your specific tool.
Inline code
Wrap text in single backticks to format it as inline code:
Use the `git status` command to check your working tree.
To escape a backtick inside inline code, use double backticks: ``code with a ` backtick``
Inline code renders in a monospace font with a subtle background, making it visually distinct from body text. Use it for command names, file paths, variable names, and short code snippets.
The markdown cheat sheet: headings and document structure
Headings
Markdown supports six heading levels, matching HTML's <h1> through <h6>:
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
There must be a space between the # symbols and the heading text. #Heading without a space will not render as a heading in most processors.
Best practice: Use H1 for the document title (one per document), H2 for major sections, and H3 for subsections. Skip levels sparingly. Jumping from H2 to H4 hurts both readability and accessibility.
Lists: ordered, unordered, and nested
Unordered list (use -, *, or +):
- First item
- Second item
- Nested item (indent 2 spaces)
- Another nested item
- Third level (indent 4 spaces)
Ordered list:
1. First item
2. Second item
1. Nested ordered item
2. Another nested item
3. Third item
Mixed nesting:
1. First ordered item
- Unordered sub-item
- Another sub-item
2. Second ordered item
Numbering shortcut: You can number every item as 1. and the processor will auto-increment:
1. First
1. Second
1. Third
This renders as 1, 2, 3. It makes reordering items easier because you do not have to renumber.
Blockquotes
> This is a blockquote.
> It can span multiple lines.
> Blockquotes can be nested.
>> This is a nested blockquote.
>>> And a third level.
> Blockquotes can contain other elements:
>
> - A list item
> - Another list item
>
> **Bold text** inside a blockquote.
Horizontal rules
Three or more hyphens, asterisks, or underscores on their own line create a horizontal rule:
---
***
___
All three produce the same result. Hyphens (---) are the most common convention.
Line breaks and paragraphs
This trips up many new markdown users:
This is paragraph one.
This is paragraph two. (Blank line = new paragraph.)
This line has two trailing spaces
to create a line break within the same paragraph.
Or use an HTML break tag for the same effect:<br>
New line here.
A blank line creates a new paragraph. Two trailing spaces (or <br>) create a line break without starting a new paragraph. Just pressing Enter once does nothing in most processors; the lines will join into one paragraph.
The markdown cheat sheet: links, images, and code blocks
Links
[Inline link](https://example.com)
[Link with title](https://example.com "Hover text appears here")
[Reference-style link][ref-id]
[ref-id]: https://example.com "Optional title"
Autolinks (GFM): Just type the URL
https://example.com
Email autolinks:
<user@example.com>
Reference-style links are useful when the same URL appears multiple times. Define it once at the bottom of the document and reference it by ID throughout.
Images


Reference-style image:
![Alt text][img-id]
[img-id]: https://example.com/image.png "Optional title"
The alt text inside the brackets is important for accessibility and SEO. Do not leave it empty.
Fenced code blocks
Fenced code blocks use triple backticks. Add a language identifier for syntax highlighting:
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
```
```python
def greet(name):
return f"Hello, {name}!"
```
```sql
SELECT users.name, COUNT(orders.id) AS order_count
FROM users
LEFT JOIN orders ON users.id = orders.user_id
GROUP BY users.name
HAVING COUNT(orders.id) > 5;
```
```bash
# Deploy to production
git checkout main
git pull origin main
npm run build && npm run deploy
```
Common language identifiers: javascript (or js), typescript (or ts), python, ruby, go, rust, java, sql, bash (or shell), html, css, json, yaml, markdown (or md).
If you are not sure which language to specify, omit it. The code will render without syntax highlighting but still appear in a monospace code block.
The markdown cheat sheet: GFM tables and task lists
GitHub Flavored Markdown (GFM) adds several widely adopted extensions. These work on GitHub, GitLab, Reddit, Discourse, Stack Exchange, Obsidian, Unmarkdown™, and most modern markdown tools.
Tables
| Feature | Free | Pro |
|-------------|------|--------|
| Documents | 5 | Unlimited |
| Templates | 8 | 62 |
| AI Actions | 10 | Unlimited |
Left-aligned (default), centered, and right-aligned columns:
| Left | Center | Right |
|:-------------|:------------:|-------------:|
| Left-aligned | Centered | Right-aligned |
| text | text | text |
Table alignment: The colons in the separator row control text alignment. :--- for left, :---: for center, ---: for right. No colon defaults to left-aligned.
Tables are one of the most common formatting elements that break when you paste AI output into other apps. Understanding the pipe-and-dash syntax helps you fix broken table formatting manually when needed.
Task lists (checkboxes)
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task
- [x] Completed subtask
- [ ] Incomplete subtask
Task lists render as interactive checkboxes on GitHub, GitLab, and many other platforms. They are useful for tracking progress in issues, pull requests, and project documentation.
Footnotes
Here is a sentence with a footnote.[^1]
Here is another with a named footnote.[^note]
[^1]: This is the footnote content.
[^note]: Footnotes can have any identifier, not just numbers.
They can also span multiple paragraphs if you indent
the continuation lines.
Footnotes render as superscript numbers that link to the footnote content at the bottom of the document. Support is widespread but not universal. GitHub added footnote support in 2021.
Alerts and admonitions
GitHub introduced alert syntax in 2023. Several other tools support the same format:
> [!NOTE]
> Useful information that users should know.
> [!TIP]
> Helpful advice for getting the most out of a feature.
> [!IMPORTANT]
> Key information users need to know.
> [!WARNING]
> Urgent info that needs immediate attention.
> [!CAUTION]
> Potential negative consequences of an action.
These render as colored callout boxes with icons. Unmarkdown™ supports all five alert types with GitHub-compatible styling.
The markdown cheat sheet: math, diagrams, and advanced features
Math with LaTeX (KaTeX/MathJax)
Inline and display math use dollar sign delimiters:
Inline math: The equation $E = mc^2$ changed physics.
Display math (centered, on its own line):
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
Matrix:
$$
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
$$
Common symbols:
- Fractions: $\frac{a}{b}$
- Square root: $\sqrt{x}$
- Summation: $\sum_{i=1}^{n} x_i$
- Greek letters: $\alpha, \beta, \gamma, \delta, \theta, \pi, \sigma, \omega$
- Subscript: $x_1, x_2$
- Superscript: $x^2, x^n$
GitHub added math support in May 2022 after the feature had been requested for over 8 years. Obsidian, Unmarkdown™, Jupyter notebooks, and most documentation platforms support it.
Diagrams with Mermaid
Mermaid diagrams render from text descriptions inside fenced code blocks:
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
```
```mermaid
sequenceDiagram
Client->>Server: POST /api/login
Server->>Database: Validate credentials
Database-->>Server: User found
Server-->>Client: 200 OK + JWT
```
```mermaid
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Phase 1
Research :a1, 2026-01-01, 14d
Design :a2, after a1, 10d
section Phase 2
Development :b1, after a2, 30d
Testing :b2, after b1, 14d
```
Mermaid supports flowcharts, sequence diagrams, Gantt charts, class diagrams, state diagrams, ER diagrams, pie charts, user journey maps, mindmaps, timelines, and git graphs. GitHub renders Mermaid natively in README files, issues, and pull requests.
Definition lists
Markdown
: A lightweight markup language for creating formatted text using plain characters.
CommonMark
: A formal specification of markdown syntax with 500+ conformance tests. Adopted by GitHub, GitLab, Reddit, and others.
GFM
: GitHub Flavored Markdown. Extends CommonMark with tables, task lists, strikethrough, and autolinks.
Definition lists use a colon followed by a space on the line after the term. Support is limited to specific processors (PHP Markdown Extra, Pandoc, some static site generators). Not part of CommonMark or GFM.
Abbreviations
The HTML specification is maintained by the W3C.
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
When a processor supports abbreviations, hovering over the abbreviated term shows the full expansion as a tooltip. This is a PHP Markdown Extra extension. Not widely supported.
Where markdown syntax works (and where it breaks)
Not all markdown is created equal. The ecosystem has three layers:
CommonMark (universal baseline). Headings, bold, italic, links, images, code blocks, blockquotes, lists, horizontal rules, and inline code. These work everywhere. If you stick to CommonMark syntax, your markdown will render correctly in any tool.
GFM extensions (widely supported). Tables, task lists, strikethrough, autolinks, fenced code blocks with language identifiers, and footnotes. These work on GitHub, GitLab, Reddit, Discourse, Stack Exchange, Obsidian, Unmarkdown™, and most modern tools. Safe to use in nearly all contexts.
Tool-specific extensions (check before using). Math ($...$), Mermaid diagrams, callout/admonition blocks, highlight (==text==), superscript/subscript, definition lists, abbreviations, and wiki-style links ([[page]]). These work in specific tools but may render as plain text or break in others.
The practical rule: use CommonMark and GFM freely. For anything else, verify that your target platform supports it before relying on it. When you share markdown with people who use different tools, sticking to the common subset avoids surprises.
One major source of confusion is pasting AI output into apps that do not render markdown. ChatGPT, Claude, and Gemini all output markdown, but copying from their web interfaces gives you rendered HTML, not raw markdown. When that HTML paste fails (gray backgrounds, broken tables, lost formatting), the underlying problem is a format mismatch, not a markdown problem.
Turning markdown into professional documents
Knowing the syntax is step one. The next question is: how do you turn raw markdown into something that looks professional enough to share with clients, stakeholders, or the public?
The answer depends on where your content needs to go. A README on GitHub renders automatically. A blog post needs a static site generator or publishing platform. A client proposal needs to end up in Google Docs or a PDF.
Unmarkdown™ handles the last mile. Write or paste markdown, apply a visual template, and copy to Google Docs, Word, Slack, OneNote, email, or a published web page. The markdown syntax from this cheat sheet becomes polished, styled content without any manual formatting.
For developers, the same markdown file can feed a docs-as-code pipeline, a static site, or an API response. For everyone else, the path from raw syntax to professional output is getting shorter every year.
Keep this markdown cheat sheet bookmarked. Once the syntax becomes muscle memory, you will wonder why you ever used anything else.
Related reading
- What Is Markdown and Why Does Every AI Tool Use It?
- Why Do Asterisks Appear When I Paste from ChatGPT?
- Markdown vs Slack mrkdwn: What's the Difference?
- The AI Formatting Problem Nobody Talks About (And How to Fix It)
- StackEdit vs HedgeDoc vs HackMD vs Unmarkdown
- Plain Text Is Not Dead: When and Why to Strip Formatting
