The Complete Markdown Cheat Sheet (2026 Edition) - All Syntax Explained
This Markdown cheat sheet covers every syntax element you need — from basic formatting to advanced GFM features. Use it as a quick reference while writing, or study it section by section to master Markdown. Try each element in our free online Markdown editor to see live results.
Headings
Use headings to structure your document. Markdown supports six levels, matching HTML's H1 through H6. Always put a space between # and the heading text.
# H1 — Document Title (use once per page)
## H2 — Major Section
### H3 — Subsection
#### H4 — Group heading
##### H5 — Minor heading
###### H6 — Detail heading
Best practices:
- Use one H1 per document as the main title
- Nest headings logically: never skip levels (e.g., H2 to H4)
- Keep headings concise and descriptive
- Most renderers auto-generate anchor links from headings
Paragraphs and Line Breaks
Separate paragraphs with a blank line. To create a line break without starting a new paragraph, end a line with two spaces.
This is a paragraph with
two trailing spaces after this line··
and this text appears on a new line.
This is a new paragraph.
Text Formatting
Apply emphasis, bold, strikethrough, and more to your text.
**Bold text**
*Italic text*
***Bold and italic***
~~Strikethrough~~ (GFM)
<ins>Underline</ins> (HTML)
<mark>Highlight</mark> (HTML)
H~2~O (subscript)
E=mc^2^ (superscript)
Nested emphasis:
**Bold with *italic* inside**produces Bold with italic inside*Italic with **bold** inside*produces Italic with bold inside
Lists
Unordered Lists
Use -, *, or + for unordered list items. Indent with two or four spaces for nesting.
- Item one
- Item two
- Nested item A
- Nested item B
- Further nested item
- Item three
Ordered Lists
Use numbers followed by periods. The numbers do not need to be sequential — Markdown renders them in order automatically.
1. First step
2. Second step
1. Sub-step (indent 4 spaces)
2. Another sub-step
3. Third step
Task Lists (GFM)
Checkboxes for task tracking. Use [x] for completed and [ ] for incomplete.
- [x] Completed task
- [ ] Uncompleted task
- [ ] Another pending task
Links
Inline Links
[Link text](https://example.com)
[Link with title](https://example.com "Optional title")
[Relative link](/markdown-to-pdf)
Reference-Style Links
Define references once and reuse them. Cleaner for documents with many links.
[Click here][reference]
[Another link][reference]
[reference]: https://example.com
Autolinks (GFM)
URLs and email addresses wrapped in angle brackets become clickable links.
<https://example.com>
<email@example.com>
GFM also auto-links bare URLs: https://example.com becomes a clickable link automatically.
Images
Images follow the same pattern as links but with a leading !.


Reference-style:
![Alt text][image-ref]
[image-ref]: https://example.com/image.jpg
Best practices: Always provide descriptive alt text for accessibility. Use relative paths for local images if your platform supports it.
Code
Inline Code
Use backticks to format inline code.
Use the `printf()` function to print text.
Fenced Code Blocks (GFM)
Use triple backticks with an optional language identifier for syntax highlighting.
\`\`\`javascript
function greet(name) {
return `Hello, ${name}!`;
}
\`\`\`
Supported languages include: javascript, python, html, css, bash, json, sql, typescript, go, rust, and many more.
Indented Code Blocks
Indent every line by four spaces for a code block without syntax highlighting.
<html>
<head>
<title>Page</title>
</head>
</html>
Tables (GFM)
Create tables using pipes and dashes. Colons control horizontal alignment.
| Left-aligned | Center-aligned | Right-aligned |
|:-------------|:--------------:|--------------:|
| Cell | Cell | Cell |
| Row 2 | Row 2 | Row 2 |
Table tips:
- The header row is required
- The alignment row must have at least three dashes per column
- Columns do not need to line up perfectly in raw text, but alignment improves readability
- Use inline formatting inside cells:
**bold**,*italic*,`code`, links - Empty cells are valid:
||
Markdown Table Generator
Creating complex tables by hand is tedious. Use our free Markdown table generator to create tables visually with an interactive editor. You can also import data from CSV, Excel, or JSON.
Blockquotes
Use > for blockquotes. Nest them by stacking > characters.
> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquote
> >
> > > Deeply nested
>
> Blockquotes can contain **other Markdown elements** like lists, code, and headings.
Horizontal Rules
Three or more dashes, asterisks, or underscores create a horizontal line. Add a blank line before and after for proper spacing.
---
***
___
Escape Characters
Prevent Markdown from interpreting syntax characters by prefixing them with a backslash.
\*This is not italic\*
\[This is not a link\](http://example.com)
\# This is not a heading
Escapable characters: \ ` * _ {} [] () # +-. !
HTML in Markdown
You can embed HTML directly. Block-level HTML tags stop Markdown processing; inline HTML is processed within Markdown.
<div class="note">
This div contains <strong>HTML</strong> and is not processed as Markdown.
</div>
This is <span style="color: red;">inline HTML</span> within a Markdown paragraph.
Footnotes (GFM)
Some Markdown processors support footnotes with [^n] syntax.
Here is a statement with a footnote.[^1]
[^1]: The footnote content appears at the bottom of the page.
Definition Lists
Some Markdown processors (including Pandoc and Markdown Extra) support definition lists.
Term
: Definition of the term
: Another definition
Next Term
: Its definition
Emoji (GFM)
GitHub Flavored Markdown supports emoji shortcodes.
:smile: :rocket: :+1: :fire: :tada:
Front Matter
Use front matter — YAML or JSON between --- delimiters — at the top of Markdown files to add metadata like title, description, date, and tags.
---
title: "My Document"
description: "A sample document"
date: 2026-07-01
tags: [markdown, documentation]
---
GFM Features Summary
GitHub Flavored Markdown (GFM) adds these extensions to standard Markdown:
| Feature | Syntax | Example |
|---|---|---|
| Strikethrough | ~~text~~ | |
| Task lists | - [x] done | ☑ checkboxes |
| Tables | | col | | structured data |
| Autolinks | <url> | clickable URLs |
| Fenced code blocks | ```lang | syntax highlighting |
| Emoji | :emoji: | 😄 smile |
| Commit/issue refs | #123, abc1234 | GitHub references |
Mermaid Diagrams (GFM)
GitHub and many Markdown tools support Mermaid diagrams using fenced code blocks:
Flowchart
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
```
Sequence Diagram
```mermaid
sequenceDiagram
participant User
participant App
participant Server
User->>App: Click button
App->>Server: API request
Server-->>App: Response
App-->>User: Update UI
```
Gantt Chart
```mermaid
gantt
title Project Timeline
section Phase 1
Research :a1, 2026-01-01, 30d
Design :a2, after a1, 20d
section Phase 2
Development :a3, after a2, 40d
Testing :a4, after a3, 20d
```
Math Formulas (LaTeX)
GitHub, Obsidian, and many Markdown processors support LaTeX math notation:
Inline Math
Use single dollar signs for inline math:
The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
Display Math
Use double dollar signs for centered display math:
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$
Common LaTeX Symbols
| Symbol | LaTeX | Description |
|---|---|---|
| Greek letters | \alpha, \beta, \gamma | Alpha, beta, gamma |
| Fractions | \frac{a}{b} | a over b |
| Square root | \sqrt{x} | Square root of x |
| Summation | \sum_{i=1}^{n} | Sum from i=1 to n |
| Integral | \int_{a}^{b} | Integral from a to b |
| Subscript | x_i | x subscript i |
| Superscript | x^2 | x squared |
Alerts (GFM)
GitHub supports alert blocks for important information:
> [!NOTE]
> Useful information that users should know.
> [!TIP]
> Helpful advice for doing things better.
> [!IMPORTANT]
> Key information users need to know.
> [!WARNING]
> Urgent content that needs immediate attention.
> [!CAUTION]
> Potential risks or negative consequences.
Platform-Specific Notes
GitHub
- Math support — Use
$for inline and$$for display math (enabled by default) - Mermaid diagrams — Full support in README, issues, and discussions
- Alerts — Use
> [!NOTE],> [!TIP], etc. for callout boxes - Task lists — Use
- [ ]and- [x]in issues and PRs for interactive checkboxes - Anchor links — Auto-generated from headings: lowercase, hyphens replace spaces
Obsidian
- Wikilinks — Use
[[Page Name]]to link to other notes - Embeds — Use
![[Page Name]]to embed content from other notes - Callouts — Use
> [!note],> [!tip], etc. for styled callout boxes - Tags — Use
#tagfor organizing notes - Front matter — Supports YAML front matter for metadata
Discord
- Limited support — Discord supports basic Markdown: bold, italic, strikethrough, code blocks
- No tables — Discord does not support Markdown tables
- No headings — Headings render as plain text
- Code blocks — Use triple backticks for multi-line code blocks
Notion
- Blocks — Notion uses a block-based editor, not traditional Markdown
- Import — Notion can import Markdown files and convert them to blocks
- Export — Notion can export pages as Markdown
- Databases — Notion databases are not represented in Markdown export
Common Markdown Mistakes
Avoid these frequent issues when writing Markdown:
- Missing space after heading markers —
#Headingdoes not render as a heading; always use# Heading - Heading level skips — Going from H2 to H4 breaks document structure; always nest sequentially
- Inconsistent list markers — Mixing
-,*, and+in the same list works but looks messy in source - No blank line before lists — Lists require a preceding blank line to render correctly
- Trailing spaces in list items — Extra spaces after list markers can cause unexpected nesting
- Table row count mismatch — Every row in a table must have the same number of cells
- Unescaped special characters — Characters like
#or*in regular text need backslash escaping - Forgetting the blank line after headings — Headings need a blank line before and after for proper rendering
- Using wrong quote types — Use straight quotes
"text"not curly quotes"text"in Markdown
Markdown for AI Prompts
Markdown is the preferred format for structuring AI prompts because it separates content from formatting efficiently. Use headings for sections, code blocks for examples, and lists for requirements. See our guide on Markdown for AI and LLM Prompts for advanced techniques.
Quick Reference Card
Keep these essentials handy:
| Element | Syntax | Renders As |
|---|---|---|
| Bold | **text** | text |
| Italic | *text* | text |
| Link | [text](url) | text |
| Image |  | image |
| Inline code | `code` | code |
| Heading | # Text | H1 heading |
| Blockquote | > text | quoted text |
| Unordered list | - item | • bullet |
| Ordered list | 1. item | 1. numbered |
| Horizontal rule | --- | horizontal line |
Convert Your Markdown Documents
Once you've written your Markdown, convert it to other formats:
- Markdown to PDF — Export your document as a professional PDF with headings, tables, and code block syntax highlighting
- Markdown to Word — Download your Markdown as an editable DOCX file for Microsoft Word or Google Docs
- Markdown to HTML — Generate clean HTML from your Markdown for web publishing
- Online Markdown Editor — Write and preview Markdown with real-time rendering
- Markdown Table Generator — Create Markdown tables without memorizing pipe syntax
- Markdown Diff Checker — Compare two Markdown drafts, README files, or documentation versions
- Free Markdown templates on GitHub — Copy reusable README, resume, documentation, meeting notes, AI prompt, and table examples
Related Guides
- How to Convert Markdown to PDF — Step-by-step guide for every workflow
- How to Create a Markdown Table of Contents — Automatic and manual methods
- Markdown Tables for Documentation — Best practices for tables in technical writing
- HTML to Markdown Conversion Guide — Tools, tips, and migration workflows
- Markdown for GitHub — Formatting README files, issues, and wikis
- Markdown for Technical Writing — Best practices for documentation and API docs
- Markdown Syntax Guide — Explanations and examples for common Markdown syntax
- Best Free Online Markdown Editors in 2026 — Reviewed and compared
- Markdown Tools Online Resources — Templates and examples for Markdown workflows