The Markdown Cheat Sheet — every element, on one page.
This Markdown cheat sheet is a structured, copy-ready reference for Markdown and GitHub Flavored Markdown — headings, lists, tables, code, math, diagrams, and inline HTML. Keep the cheat sheet handy as a quick lookup, then paste any snippet into the Markdown Viewer or the Markdown to HTML converter to see it rendered live.
Last updated: July 2026
Basics
Headings
| Element | Markdown |
|---|---|
| Heading 1 | # H1 |
| Heading 2 | ## H2 |
| Heading 3 | ### H3 |
| Heading 4–6 | #### … ###### |
Use one # per level, followed by a space. Keep a single H1 per document and don't skip levels — clean heading structure helps readers, HTML conversion, and SEO.
H1 and H2 also accept an underline style:
Title
=====
Section
-------Emphasis & text styling
| Element | Markdown |
|---|---|
| Bold | **bold** |
| Italic | *italic* |
| Bold + italic | ***both*** |
| Strikethrough | ~~struck~~ |
| Inline code | `code` |
Underscores work too (__bold__, _italic_), but asterisks are safer mid-word. Strikethrough is a GitHub Flavored Markdown (GFM) extension.
Paragraphs & line breaks
A blank line starts a new paragraph.
This is a separate paragraph.Within a paragraph, end a line with two trailing spaces or a backslash (\) to force a hard line break. Wrapping lines in your source without a blank line between them are joined into one paragraph.
Blockquotes
> Single-line quote.
> Multi-line quote
> continues here.
>
> > Nested quote inside a quote.Prefix each line with >. Quotes can contain other markdown — lists, code, even headings. On GitHub, > [!NOTE] and > [!WARNING] render as colored alert callouts.
Horizontal rules
---
***
___Three or more hyphens, asterisks, or underscores on their own line produce a rule. Leave a blank line above --- so it isn't parsed as a heading underline.
Lists & tables
Lists
- Unordered item
- Another item
- Nested item (indent 2–4 spaces)
1. Ordered item
2. Second item
1. Nested ordered itemUnordered lists accept -, *, or +. Ordered lists renumber automatically, so starting every line with 1. also works.
Task lists (GFM)
- [x] Completed task
- [ ] Pending task
- [ ] Another to-doTask lists render as checkboxes on GitHub and in the Markdown Viewer — where clicking a checkbox updates the source.
Tables
| Left | Center | Right |
| :---- | :----: | ----: |
| a | b | c |
| dd | ee | ff |Pipes don't need to line up — only the structure matters. Control alignment with colons in the divider row: :--- left, :---: center, ---: right. Escape a literal pipe inside a cell as \|.
Definition lists
Term
: Definition of the term
Markdown
: A lightweight markup language
: A plain-text formatting syntaxNot part of core Markdown, but supported by many processors (PHP Markdown Extra, Pandoc). Put the term on one line and each definition on the next, prefixed with :.
Links & media
Links
[Inline link](https://example.com)
[With title](https://example.com "Tooltip text")
[Reference link][ref]
<https://autolinked.example.com>
[ref]: https://example.comReference links keep long URLs out of your prose — define [ref]: anywhere in the document. Bare URLs in angle brackets (or plain, in GFM) become clickable automatically.
Images

![Reference image][logo]
[logo]: /assets/logo.png
[](https://example.com)Image syntax is link syntax with a leading !. Wrap an image in a link to make it clickable. Always write meaningful alt text — it matters for accessibility and image SEO.
Footnotes
Here is a statement that needs a source.[^1]
You can also use inline notes.[^note]
[^1]: The first footnote definition.
[^note]: Footnotes render at the bottom of the document.Reference a footnote with [^label] and define it anywhere with [^label]:. Supported by GFM, Pandoc, and most modern renderers.
Code & math
Code & syntax highlighting
Inline code uses `backticks`.
```js
function greet(name) {
return `Hello, ${name}!`;
}
```Fence blocks with triple backticks and add a language hint (js, python, json, rust, sql…) for highlighting — this site recognizes 190+ languages. To show literal backticks inline, wrap them in a longer run of backticks.
Math (LaTeX)
Inline math: $E = mc^2$ and $\alpha + \beta$
Display math:
$$\int_a^b f(x)\,dx = F(b) - F(a)$$
$$\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}$$Wrap inline math in single $ and display math in double $$. Rendering is powered by KaTeX in the Markdown Viewer.
Diagrams & HTML
Mermaid diagrams
```mermaid
flowchart LR
A[Start] --> B{Working?}
B -->|Yes| C[Ship it]
B -->|No| A
```A fenced block tagged mermaid becomes a flowchart, sequence diagram, Gantt chart, and more. GitHub, GitLab, Notion, and Obsidian render it natively. Paste examples into the Markdown Viewer for fullscreen zoom and PNG/SVG export.
Inline HTML
| Element | Markdown |
|---|---|
| Superscript | x<sup>2</sup> |
| Subscript | H<sub>2</sub>O |
| Keyboard key | <kbd>Ctrl</kbd> |
| Highlight | <mark>marked</mark> |
| Abbreviation | <abbr title="…">HTML</abbr> |
Markdown allows raw HTML for the few things it has no syntax for. Some platforms (like GitHub comments) strip certain tags; the ones above are widely supported.
Emoji & symbols
Shortcodes (GFM): :rocket: :sparkles: :tada:
Unicode: 🚀 ✨ 🎉
HTML entities: © → ♥GitHub and many renderers support :shortcode: emoji. Pasting Unicode emoji directly always works, and HTML entities cover symbols without a key.
Reference
Escaping characters
\*Not italic\* and \*\*not bold\*\*
\# Not a heading
\- Not a list itemPut a backslash before a character markdown would otherwise interpret: \* \_ \` \# \[ \] \( \) \| \\.
Platform differences
- GitHub — full GFM plus Mermaid, math, footnotes, and alerts (
> [!NOTE]). - Discord — bold, italic, underline, strikethrough, code, spoilers (
||text||), headers, and subtext; no tables or images. See the Discord Markdown cheat sheet for the full syntax and a live preview. - Reddit — basic syntax plus tables and superscript (
^text); fenced code works in newer editors. - Slack — its own "mrkdwn": single asterisks for bold, underscores for italic; standard links don't work.
- Obsidian — CommonMark and GFM plus wikilinks, embeds, callouts, and
==highlights==. See the Obsidian Markdown cheat sheet for the full syntax and a live reading-view preview.
Ready to try it?
Open the editor — its built-in sample contains every element on this page — and export the result as HTML or PDF.