Markdown syntax cheat sheet — every rule with live preview side by side, GFM + flavors.
- Runs locally
- Category Developer & DevOps
- Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
Basic (17)
Heading 1
# Heading 1
Top-level heading. ATX style with `#`.
Heading 1
Heading 2
## Heading 2
Section heading.
Heading 2
Heading 3
### Heading 3
Sub-section heading. Up to 6 levels (`######`).
Heading 3
Setext heading
Big title ========= Smaller title -------------
Alternate heading: `===` underlines H1, `---` underlines H2.
Note: Only H1 and H2 supported in Setext form.
Big title
Smaller title
Paragraph
A paragraph is just text with a soft wrap. Blank line starts new paragraph.
Plain text separated by blank lines becomes paragraphs.
A paragraph is just text with a soft wrap.
Blank line starts new paragraph.
Bold
**bold text** or __bold text__
Wrap text with two `*` or two `_`.
bold text or bold text
Italic
*italic* or _italic_
Single `*` or `_`. Avoid mid-word `_` to prevent surprises.
italic or italic
Bold + italic
***bold italic*** or **_mixed_**
Three `*` or combine `**` with `_`.
bold italic or mixed
Horizontal rule
--- or *** or ___
Three or more `-`, `*`, or `_` on their own line.
or
or
Line break
line one line two
Two trailing spaces force a hard break inside a paragraph.
Note: Or use a `\` backslash at end of line.
line one line two
Escape
\*literal asterisks\* and \_underscores\_
Backslash before a special character to render it literally.
\literal asterisks\ and \underscores\
Heading with explicit id
## Setup {#install}Some renderers (GitLab, kramdown, Pandoc) accept `{#id}` to override the auto slug.
Note: Not GFM. GitHub ignores the braces and renders them as text.
Setup {#install}
Soft wrap vs hard break
line one line two becomes one line blank line splits paragraphs
A single newline is a soft wrap: it joins into one line. A blank line splits paragraphs.
line one line two becomes one line
blank line splits paragraphs
Bold inside a word
un**believ**able
`**` works mid-word, but `__` does not — intra-word `_` is left literal in CommonMark.
unbelievable
Escape a backtick
A literal backtick: \`
Backslash escapes a backtick outside code spans.
A literal backtick: \`
Spaced horizontal rule
- - - or * * *
The three rule characters may have spaces between them.
or
Backslash line break
line one\ line two
A trailing backslash forces a hard break — more visible than two spaces.
Note: CommonMark and GFM support it; some older parsers do not.
line one\ line two
Lists (10)
Unordered list
- apple - banana - cherry
Use `-`, `*`, or `+` followed by a space.
- apple
- banana
- cherry
Ordered list
1. first 2. second 3. third
Numbers followed by `.`. Numbers can be all `1.` — renderer renumbers.
- first
- second
- third
Nested list
- top
- nested
- deeper
- back to topIndent nested items by 2 spaces (CommonMark) or 4 (some flavors).
- top
- nested
- deeper
- back to top
Mixed nested
1. ordered - bullet - bullet 2. ordered
Mix `1.` with `-` at different indent levels.
- ordered
- bullet
- bullet
- ordered
Ordered list custom start
5. five 6. six 7. seven
The first number sets the start; the rest are renumbered from it.
- five
- six
- seven
Ordered list with parenthesis
1) first 2) second
CommonMark also accepts `)` as the ordered-list delimiter, not only `.`.
1) first 2) second
Loose list (blank lines)
- item one - item two - item three
Blank lines between items make a loose list — each item wraps in `<p>`.
- item one
- item two
- item three
Multi-paragraph list item
1. First paragraph. Second paragraph, indented 3 spaces. 2. Next item.
Indent continuation text to align under the item content to keep it inside.
- First paragraph.
Second paragraph, indented 3 spaces.
- Next item.
Code block inside list
- step: ```sh npm run build ```
Indent a fenced block under the item (blank line + alignment) to nest it.
- step:
npm run buildDefinition list
Term : Definition of the term : Second definition
Pandoc/kramdown/PHP Markdown Extra: term then `:` lines. Not in CommonMark/GFM.
Note: GitHub renders this as plain text.
Term : Definition of the term : Second definition
Links & Images (12)
Inline link
[Toolora](https://toolora.com)
Most common form. Text in `[]`, URL in `()`.
Link with title
[Toolora](https://toolora.com "Tooltip")
Quoted string after URL becomes the hover tooltip.
Reference link
Visit [Toolora][site] today. [site]: https://toolora.com "Tooltip"
Define the URL elsewhere — handy for repeated links and long URLs.
Visit [Toolora][site] today.
[site]: https://toolora.com "Tooltip"
Autolink
<https://toolora.com> or <hi@toolora.com>
Bare URL or email wrapped in `<>` becomes clickable.
https://toolora.com or <hi@toolora.com>
Image

Like a link but prefixed with `!`. Alt text shown if image fails.

Image with title

Title in quotes appears on hover.

Reference image
![logo][img] [img]: https://toolora.com/logo.png
Reference-style for images — same shape as reference links.
![logo][img]
[img]: https://toolora.com/logo.png
Implicit reference link
Read the [docs][]. [docs]: https://toolora.com/docs
Empty `[]` reuses the link text as the reference label.
Read the [docs][].
[docs]: https://toolora.com/docs
Relative link
See [the readme](./README.md) and [a section](../docs/setup.md#install).
Relative paths resolve against the current file location on most hosts.
See the readme and a section.
Image wrapped in a link
[](https://toolora.com)
Nest an image inside a link to make the image clickable.
Email link
[Email us](mailto:hi@toolora.com)
Use a `mailto:` URL in a normal inline link to open the mail client.
Badge image

Badges are just images pointing at a badge service like shields.io.
Code (11)
Inline code
Run `npm install` then go.
Wrap in single backticks.
Run npm install then go.
Inline code with backtick
Use `` `code` `` if your code contains a backtick.
Double backtick lets you embed a single backtick.
Use ` code ` if your code contains a backtick.
Fenced code block
``` const x = 1; console.log(x); ```
Three backticks on their own lines wrap a multi-line code block.
const x = 1;
console.log(x);Code block with language
```js const x = 1; console.log(x); ```
Add a language identifier after the opening fence for syntax highlighting.
const x = 1;
console.log(x);Tilde fenced code
~~~python
print("hi")
~~~Tilde `~~~` is an alternate fence — useful when code contains triple backticks.
print("hi")Indented code block
Normal paragraph.
indented 4 spaces
is a code blockIndent 4 spaces (or 1 tab). Older syntax — prefer fenced.
Normal paragraph.
indented 4 spaces is a code block
Fence with four backticks
```` ``` nested fence shown literally ``` ````
A longer fence wraps content that itself contains a triple-backtick fence.
nested fence shown literally
Inline code edge spaces
`` `a` ``
One leading and trailing space is stripped, letting the code start/end with a backtick.
` a `
Diff syntax highlight
```diff - old line + new line ```
The `diff` language colors `+`/`-` lines green and red on GitHub.
- old line
+ new lineMermaid diagram
```mermaid graph TD A --> B B --> C ```
GitHub and GitLab render a ` ```mermaid ` block as a diagram.
Note: Plain CommonMark shows it as a code block.
graph TD
A --> B
B --> CJSON code block
```json
{
"name": "toolora",
"private": true
}
```Tag the fence `json` for keys-and-values highlighting.
{
"name": "toolora",
"private": true
}Tables (8)
Basic table
| Name | Age | | ---- | --- | | Alice | 30 | | Bob | 25 |
Pipe-delimited cells. Separator row required.
Note: GFM extension. CommonMark does not include tables.
| Name | Age |
|---|---|
| Alice | 30 |
| Bob | 25 |
Aligned table
| Left | Center | Right | | :--- | :----: | ----: | | a | b | c |
Use `:` in the separator row: `:---` left, `:---:` center, `---:` right.
| Left | Center | Right |
|---|---|---|
| a | b | c |
Table with inline formatting
| Name | Link | | ---- | ---- | | **bold** | [site](https://x.com) |
Cells accept inline formatting: bold, italic, links, inline code.
Note: Block content (lists, fenced code) is NOT allowed in pipe-table cells.
| Name | Link |
|---|---|
| bold | site |
Escape pipe in cell
| Name | Code | | ---- | ---- | | or | a \| b |
Use `\|` to put a literal `|` inside a cell.
| Name | Code |
|---|---|
| or | a | b |
Ragged table rows
| A | B | C | | - | - | - | | 1 | 2 | | 1 | 2 | 3 | 4 |
Short rows pad with empty cells; extra cells are dropped.
| A | B | C | |
|---|---|---|---|
| 1 | 2 | ||
| 1 | 2 | 3 | 4 |
Minimal separator
| A | B | | - | - | | 1 | 2 |
A single `-` per column is enough in the separator row.
| A | B |
|---|---|
| 1 | 2 |
Table without outer pipes
A | B --- | --- 1 | 2
Leading and trailing `|` are optional in GFM tables.
| A | B |
|---|---|
| 1 | 2 |
Line break in cell
| Item | Notes | | ---- | ----- | | A | line1<br>line2 |
Use `<br>` for a line break inside a cell — newlines are not allowed.
| Item | Notes |
|---|---|
| A | line1<br>line2 |
Blockquotes (6)
Blockquote
> This is a quote. > Wrapped onto a second line.
Prefix each line with `>`.
This is a quote. Wrapped onto a second line.
Nested blockquote
> Outer quote > > Inner quote > back to outer
Use `> >` for nesting.
Outer quote > Inner quote back to outer
Blockquote with content
> ## Quoted heading > > Paragraph with **bold**. > > - list item
Blockquotes can contain any other Markdown block.
## Quoted heading Paragraph with bold. - list item
Lazy blockquote continuation
> First line still the same quote
A line right after a `>` line joins the quote even without its own `>`.
First line
still the same quote
Code inside blockquote
> Run this: > > ```sh > npm ci > ```
Prefix each fenced-code line with `>` to keep it inside the quote.
Run this: ```sh npm ci ```
GitHub alert (callout)
> [!NOTE] > Useful information. > [!WARNING] > Be careful here.
GitHub renders `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, `[!CAUTION]` as colored callouts.
Note: GitHub-specific. Other renderers show a plain blockquote.
[!NOTE] Useful information.
[!WARNING] Be careful here.
HTML (10)
Inline HTML
Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to copy.
Inline HTML tags pass through as-is.
Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to copy.
Block HTML
<details> <summary>Click to expand</summary> Hidden content. </details>
Block-level HTML passes through. Common for `<details>`, `<table>`.
Note: Many renderers sanitize away <script>, <style>, <iframe>, on* handlers.
Click to expand
Hidden content.
</details>
HTML comment
<!-- This is a comment, not rendered. -->
HTML comments are stripped from output. Useful as TODO notes.
Subscript / superscript
H<sub>2</sub>O and E = mc<sup>2</sup>
No native syntax — use `<sub>` and `<sup>` HTML tags.
H<sub>2</sub>O and E = mc<sup>2</sup>
Details open by default
<details open> <summary>Shown expanded</summary> Content. </details>
Add the `open` attribute to render `<details>` already expanded.
Shown expanded
Content.
</details>
Markdown inside HTML block
<div> **This is bold** inside a div. </div>
A blank line after the opening tag lets Markdown render inside the block.
Note: Without the blank line, the inner text is treated as raw HTML.
This is bold inside a div.
</div>
Explicit break tag
first line<br>second line
A literal `<br>` forces a line break anywhere inline.
first line<br>second line
Centered content
<p align="center"> <img src="logo.png" width="120"> </p>
Markdown has no alignment; use `<p align="center">` or `<div align="center">`.
Manual anchor target
<a id="top"></a> ... later: [back to top](#top)
An empty `<a id="...">` makes a jump target when auto slugs are not enough.
... later: back to top
HTML entity
Price: 5 USD — in stock © 2026
Named/numeric entities like ` `, `©`, `→` pass through to output.
Price: 5 USD — in stock © 2026
GFM Extensions (12)
Strikethrough
~~struck through~~
Two `~` on each side. GFM extension.
Note: Not in CommonMark spec — GFM/GitLab/Bitbucket all support.
struck through
Task list
- [ ] todo - [x] done - [ ] another
`- [ ]` for unchecked, `- [x]` for checked. GFM extension.
Note: GitHub/GitLab/Bitbucket render checkboxes; CommonMark renders as text.
- todo
- done
- another
GFM autolink
Just paste https://toolora.com — GFM auto-links.
GFM extension: bare URLs become links without `<>`.
Note: CommonMark requires `<>`. GitHub/GitLab/Bitbucket auto-link without.
Just paste https://toolora.com — GFM auto-links.
Footnote
Here is a claim.[^1] [^1]: Citation goes here.
Inline reference + footnote definition. GFM/GitLab support.
Note: CommonMark does not include footnotes. Bitbucket does not support.
Here is a claim.[^1]
[^1]: Citation goes here.
GitHub mention
cc @octocat please review
`@user` becomes a link to that user. GitHub-only.
cc @octocat please review
Issue reference
Fixes #42 and closes owner/repo#7
`#123` and `owner/repo#123` auto-link to issues. GitHub/GitLab.
Fixes #42 and closes owner/repo#7
Emoji shortcode
I :heart: Markdown :sparkles:
`:name:` renders as emoji. GitHub-specific extension.
Note: Renders literally on non-GitHub viewers.
I :heart: Markdown :sparkles:
Nested task list
- [x] parent done - [ ] child todo - [x] child done
Indent child checkboxes under a parent item to nest tasks.
- parent done
- child todo
- child done
Multiple footnotes
Claim one.[^a] Claim two.[^b] [^a]: First note. [^b]: Second note.
Labels can be any identifier, not just numbers; output is renumbered in order.
Claim one.[^a] Claim two.[^b]
[^a]: First note. [^b]: Second note.
GFM www autolink
Visit www.toolora.com for tools.
GFM auto-links bare `www.` hosts, adding `http://` for you.
Note: CommonMark does not auto-link www-only hosts.
Visit www.toolora.com for tools.
Commit SHA reference
Fixed in a1b2c3d and owner/repo@f4e5d6c
GitHub auto-links 7+ char commit hashes, optionally `owner/repo@sha`.
Fixed in a1b2c3d and owner/repo@f4e5d6c
Unicode emoji
Ship it 🚀 — works everywhere.
A pasted Unicode emoji renders on every viewer, unlike `:shortcode:`.
Ship it 🚀 — works everywhere.
Flavors (13)
CommonMark
# Heading Paragraph with [link](url) and `code`.
The strict baseline spec. No tables, no task lists, no strikethrough, no footnotes.
Heading
Paragraph with link and code.
GitHub Flavored Markdown
CommonMark + tables + task lists + ~~strike~~ + autolinks + emoji + @mentions + #refs
Superset of CommonMark. Adds tables, task lists, strikethrough, autolinks, emoji, @mentions, #issue refs.
CommonMark + tables + task lists + strike + autolinks + emoji + @mentions + #refs
GitLab Flavored Markdown
GFM + math via $...$ + diagrams + video/audio embeds
GFM superset. Adds math `$...$`, mermaid diagrams, video/audio embeds, MR refs.
GFM + math via $...$ + diagrams + video/audio embeds
Bitbucket Markdown
CommonMark base + anchor prefix: #markdown-header-my-heading
Closer to CommonMark. Anchors use `markdown-header-` prefix — GFM-style intra-doc links break.
CommonMark base + anchor prefix: #markdown-header-my-heading
Heading anchor link
See [Setup](#setup) below. ## Setup
Headings get auto-generated `id` slugs. Link via `#slug`. Slug rules differ per host.
See Setup below.
Setup
Video embed (GitLab)

GitLab renders video formats as a `<video>` player. GitHub/Bitbucket render as a broken image.
Math (GitLab)
Inline: $E = mc^2$
Block:
```math
\sum_{i=1}^n i = \frac{n(n+1)}{2}
```GitLab supports `$...$` inline and ` ```math ` block. GitHub uses `$...$` since 2022.
Inline: $E = mc^2$
Block:
\sum_{i=1}^n i = \frac{n(n+1)}{2}YAML front matter
--- title: My Post date: 2026-05-30 --- Body starts here.
Jekyll, Hugo, Astro and 11ty read a `---` fenced YAML block for metadata.
Note: Plain CommonMark renders the first `---` as a horizontal rule.
title: My Post
date: 2026-05-30
Body starts here.
Table of contents marker
[[_TOC_]]
GitLab inserts an auto table of contents at `[[_TOC_]]` (or `[TOC]` on some hosts).
Note: GitHub renders its own TOC from the file outline, no marker needed.
[[TOC]]
Highlighted text
This is ==highlighted== text.
`==text==` becomes `<mark>` in Obsidian, Pandoc and some others. Not in GFM.
This is ==highlighted== text.
Wiki-style link
[[Page Name]] and [[Page Name|display text]]
Obsidian, GitHub wikis and DokuWiki link by page title with `[[...]]`.
Note: Not part of CommonMark or GFM document Markdown.
[[Page Name]] and [[Page Name|display text]]
Obsidian callout
> [!info] Title > Body of the callout.
Obsidian extends blockquotes with `[!type]` callouts (info, tip, warning, …).
[!info] Title Body of the callout.
Comment via empty link
[//]: # (This is an invisible comment.)
A link-reference definition with no use renders nothing — a portable comment.
[//]: # (This is an invisible comment.)
What this tool does
Free online Markdown cheat sheet with 50+ syntax rules and a live preview pane on the right side of every example. Headings, bold, italic, strikethrough, ordered and unordered lists, nested lists, task lists, inline links, reference links, autolinks, inline images, inline code, fenced code blocks with language hints, pipe tables with alignment, block quotes, horizontal rules, raw HTML embeds, footnotes — each rule shows the exact source you type on the left and what it renders to on the right, so you never have to guess. We also call out the small but annoying differences between CommonMark, GitHub Flavored Markdown, GitLab Flavored Markdown, and Bitbucket. GFM adds task lists, strikethrough, autolinks, and tables. GitLab adds video embeds and math. Bitbucket prefixes anchors with `markdown-header-`. Hit "Copy" on any rule to grab the syntax. Search the table top-to-bottom or filter by category. 100% browser-side — no upload, no tracking.
Tool details
- Input
- Text + Numbers + Structured content
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy + Preview
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- No account required
- Open the page and use it; whether results survive refresh depends on the tool.
- Performance budget
- Initial JS <= 22 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Developer & DevOps · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How Markdown Cheat Sheet fits into your work
Use it in the small gaps between coding, reviewing, debugging, and shipping.
Developer jobs
- Formatting, validating, shrinking, or inspecting code-adjacent text.
- Preparing snippets for documentation, tickets, commits, or handoff.
- Checking a small payload quickly without switching tools.
Developer checks
- Run irreversible transforms like minify or obfuscate on a copy.
- Keep secrets out of pasted snippets unless the tool explicitly stays local.
- Use your normal tests or linter before shipping transformed code.
Good next steps
These links move the current task into a more complete workflow.
- 1 Markdown to HTML Convert Markdown to clean HTML — headings, lists, code, links, images, tables — instant live preview, browser-only Open
- 2 HTML to Markdown HTML to Markdown — paste rich content, get clean .md with links, code, tables, lists preserved. Open
- 3 Markdown TOC Generator Markdown TOC generator — paste your markdown, get a clean table of contents with anchor links. Open
Real-world use cases
Fixing a table that renders as raw pipes in a pull request
You paste a 6-column table into a GitHub PR description and it shows up as literal `| name | value |` text. Open the cheat sheet, find the table rule, and check the separator row: it needs exactly one `---` cell per column, and a blank line must sit above the header. Copy the working skeleton, swap in your data, and the diff renders clean.
Writing a README badge row without breaking the image syntax
You want three shield.io badges side by side at the top of a README, but one keeps showing as broken alt text. The image rule reminds you an inline image is `` with no space after the bang, and that wrapping it in a link is `[](href)`. Copy that nested form, paste your three badges on one line, and they line up.
Porting docs from GitHub to GitLab and losing the anchor links
A teammate moves a 40-page wiki from GitHub to GitLab and every `[jump](#section-name)` link dies. The flavor comparison row shows GitLab keeps GFM anchors but Bitbucket prefixes them with `markdown-header-`. You confirm the move is GitHub to GitLab, so the anchors should hold, and the real culprit is a renamed heading.
Teaching a writer to escape a literal asterisk in pricing copy
A content writer types `*Terms apply` and the line turns italic and eats the rest of the paragraph. You point them at the escape rule: put a backslash before the asterisk, so `\*Terms apply` prints the star literally. The same trick fixes underscores in file names like `my\_file\_name` that Markdown would otherwise read as emphasis.
Common pitfalls
Forgetting the blank line above a table or list. `paragraph` then a table on the very next line renders as one merged paragraph. Add an empty line between them and both render correctly.
Putting a space after the bang in an image, like `! [alt](url)`. That space turns it into a link with a literal `!` in front. Write `` with no space to get an actual image.
Indenting a fenced code block with spaces inside a list and losing the fence. Keep all three backticks at the same indent as the list item text, not deeper, or the closing fence stops matching.
Privacy
Everything you type into the live preview pane runs in your browser and never leaves it. There is no upload, no server round-trip, and the cheat sheet does not write your text into the URL, so nothing you paste shows up in a shareable link or browser history beyond your own tab. The page is static and works fully offline once loaded.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only