Skip to main content

Markdown Cheat Sheet — Every Rule with Live Preview

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 `#`.

Preview

Heading 1

Heading 2

## Heading 2

Section heading.

Preview

Heading 2

Heading 3

### Heading 3

Sub-section heading. Up to 6 levels (`######`).

Preview

Heading 3

Setext heading

Big title
=========

Smaller title
-------------

Alternate heading: `===` underlines H1, `---` underlines H2.

Note: Only H1 and H2 supported in Setext form.

Preview

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.

Preview

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 `_`.

Preview

bold text or bold text

Italic

*italic* or _italic_

Single `*` or `_`. Avoid mid-word `_` to prevent surprises.

Preview

italic or italic

Bold + italic

***bold italic*** or **_mixed_**

Three `*` or combine `**` with `_`.

Preview

bold italic or mixed

Horizontal rule

---

or

***

or

___

Three or more `-`, `*`, or `_` on their own line.

Preview

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.

Preview

line one line two

Escape

\*literal asterisks\* and \_underscores\_

Backslash before a special character to render it literally.

Preview

\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.

Preview

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.

Preview

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.

Preview

unbelievable

Escape a backtick

A literal backtick: \`

Backslash escapes a backtick outside code spans.

Preview

A literal backtick: \`

Spaced horizontal rule

- - -

or

* * *

The three rule characters may have spaces between them.

Preview

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.

Preview

line one\ line two

Lists (10)

Unordered list

- apple
- banana
- cherry

Use `-`, `*`, or `+` followed by a space.

Preview
  • apple
  • banana
  • cherry

Ordered list

1. first
2. second
3. third

Numbers followed by `.`. Numbers can be all `1.` — renderer renumbers.

Preview
  1. first
  2. second
  3. third

Nested list

- top
  - nested
    - deeper
- back to top

Indent nested items by 2 spaces (CommonMark) or 4 (some flavors).

Preview
  • top
  • nested
  • deeper
  • back to top

Mixed nested

1. ordered
   - bullet
   - bullet
2. ordered

Mix `1.` with `-` at different indent levels.

Preview
  1. ordered
  • bullet
  • bullet
  1. ordered

Ordered list custom start

5. five
6. six
7. seven

The first number sets the start; the rest are renumbered from it.

Preview
  1. five
  2. six
  3. seven

Ordered list with parenthesis

1) first
2) second

CommonMark also accepts `)` as the ordered-list delimiter, not only `.`.

Preview

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>`.

Preview
  • 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.

Preview
  1. First paragraph.

Second paragraph, indented 3 spaces.

  1. Next item.

Code block inside list

- step:

  ```sh
  npm run build
  ```

Indent a fenced block under the item (blank line + alignment) to nest it.

Preview
  • step:
  npm run build

Definition 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.

Preview

Term : Definition of the term : Second definition

Links & Images (12)

Inline link

[Toolora](https://toolora.com)

Most common form. Text in `[]`, URL in `()`.

Preview

Link with title

[Toolora](https://toolora.com "Tooltip")

Quoted string after URL becomes the hover tooltip.

Preview

Reference link

Visit [Toolora][site] today.

[site]: https://toolora.com "Tooltip"

Define the URL elsewhere — handy for repeated links and long URLs.

Preview

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.

Preview

https://toolora.com or <hi@toolora.com>

Image

![alt text](https://toolora.com/logo.png)

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

Preview

alt text

Image with title

![alt](https://toolora.com/logo.png "Logo")

Title in quotes appears on hover.

Preview

alt

Reference image

![logo][img]

[img]: https://toolora.com/logo.png

Reference-style for images — same shape as reference links.

Preview

![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.

Preview

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.

Preview

Image wrapped in a link

[![alt](icon.png)](https://toolora.com)

Nest an image inside a link to make the image clickable.

Preview

alt

Email link

[Email us](mailto:hi@toolora.com)

Use a `mailto:` URL in a normal inline link to open the mail client.

Preview

Badge image

![build](https://img.shields.io/badge/build-passing-brightgreen)

Badges are just images pointing at a badge service like shields.io.

Preview

build

Code (11)

Inline code

Run `npm install` then go.

Wrap in single backticks.

Preview

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.

Preview

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.

Preview
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.

Preview
const x = 1;
console.log(x);

Tilde fenced code

~~~python
print("hi")
~~~

Tilde `~~~` is an alternate fence — useful when code contains triple backticks.

Preview
print("hi")

Indented code block

Normal paragraph.

    indented 4 spaces
    is a code block

Indent 4 spaces (or 1 tab). Older syntax — prefer fenced.

Preview

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.

Preview

nested fence shown literally

Inline code edge spaces

`` `a` ``

One leading and trailing space is stripped, letting the code start/end with a backtick.

Preview

` a `

Diff syntax highlight

```diff
- old line
+ new line
```

The `diff` language colors `+`/`-` lines green and red on GitHub.

Preview
- old line
+ new line

Mermaid 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.

Preview
graph TD
  A --> B
  B --> C

JSON code block

```json
{
  "name": "toolora",
  "private": true
}
```

Tag the fence `json` for keys-and-values highlighting.

Preview
{
  "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.

Preview
NameAge
Alice30
Bob25

Aligned table

| Left | Center | Right |
| :--- | :----: | ----: |
| a    | b      | c     |

Use `:` in the separator row: `:---` left, `:---:` center, `---:` right.

Preview
LeftCenterRight
abc

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.

Preview
NameLink
boldsite

Escape pipe in cell

| Name | Code |
| ---- | ---- |
| or   | a \| b |

Use `\|` to put a literal `|` inside a cell.

Preview
NameCode
ora | b

Ragged table rows

| A | B | C |
| - | - | - |
| 1 | 2 |
| 1 | 2 | 3 | 4 |

Short rows pad with empty cells; extra cells are dropped.

Preview
ABC
12
1234

Minimal separator

| A | B |
| - | - |
| 1 | 2 |

A single `-` per column is enough in the separator row.

Preview
AB
12

Table without outer pipes

A | B
--- | ---
1 | 2

Leading and trailing `|` are optional in GFM tables.

Preview
AB
12

Line break in cell

| Item | Notes |
| ---- | ----- |
| A | line1<br>line2 |

Use `<br>` for a line break inside a cell — newlines are not allowed.

Preview
ItemNotes
Aline1<br>line2

Blockquotes (6)

Blockquote

> This is a quote.
> Wrapped onto a second line.

Prefix each line with `>`.

Preview

This is a quote. Wrapped onto a second line.

Nested blockquote

> Outer quote
> > Inner quote
> back to outer

Use `> >` for nesting.

Preview

Outer quote > Inner quote back to outer

Blockquote with content

> ## Quoted heading
>
> Paragraph with **bold**.
>
> - list item

Blockquotes can contain any other Markdown block.

Preview

## 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 `>`.

Preview

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.

Preview

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.

Preview

[!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.

Preview

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.

Preview
Click to expand

Hidden content.

</details>

HTML comment

<!-- This is a comment, not rendered. -->

HTML comments are stripped from output. Useful as TODO notes.

Preview

Subscript / superscript

H<sub>2</sub>O and E = mc<sup>2</sup>

No native syntax — use `<sub>` and `<sup>` HTML tags.

Preview

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.

Preview
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.

Preview

This is bold inside a div.

</div>

Explicit break tag

first line<br>second line

A literal `<br>` forces a line break anywhere inline.

Preview

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">`.

Preview

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.

Preview

... later: back to top

HTML entity

Price: 5&nbsp;USD &mdash; in stock &copy; 2026

Named/numeric entities like `&nbsp;`, `&copy;`, `&#8594;` pass through to output.

Preview

Price: 5&nbsp;USD &mdash; in stock &copy; 2026

GFM Extensions (12)

Strikethrough

~~struck through~~

Two `~` on each side. GFM extension.

Note: Not in CommonMark spec — GFM/GitLab/Bitbucket all support.

Preview

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.

Preview
  • 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.

Preview

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.

Preview

Here is a claim.[^1]

[^1]: Citation goes here.

GitHub mention

cc @octocat please review

`@user` becomes a link to that user. GitHub-only.

Preview

cc @octocat please review

Issue reference

Fixes #42 and closes owner/repo#7

`#123` and `owner/repo#123` auto-link to issues. GitHub/GitLab.

Preview

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.

Preview

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.

Preview
  • 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.

Preview

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.

Preview

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`.

Preview

Fixed in a1b2c3d and owner/repo@f4e5d6c

Unicode emoji

Ship it 🚀 — works everywhere.

A pasted Unicode emoji renders on every viewer, unlike `:shortcode:`.

Preview

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.

Preview

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.

Preview

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.

Preview

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.

Preview

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.

Preview

See Setup below.

Setup

Video embed (GitLab)

![Demo](demo.mp4)

GitLab renders video formats as a `<video>` player. GitHub/Bitbucket render as a broken image.

Preview

Demo

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.

Preview

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.

Preview

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.

Preview

[[TOC]]

Highlighted text

This is ==highlighted== text.

`==text==` becomes `<mark>` in Obsidian, Pandoc and some others. Not in GFM.

Preview

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.

Preview

[[Page Name]] and [[Page Name|display text]]

Obsidian callout

> [!info] Title
> Body of the callout.

Obsidian extends blockquotes with `[!type]` callouts (info, tip, warning, …).

Preview

[!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.

Preview

[//]: # (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. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 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. 1 Markdown to HTML Convert Markdown to clean HTML — headings, lists, code, links, images, tables — instant live preview, browser-only Open
  2. 2 HTML to Markdown HTML to Markdown — paste rich content, get clean .md with links, code, tables, lists preserved. Open
  3. 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 `![alt](url)` with no space after the bang, and that wrapping it in a link is `[![alt](img)](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 `![alt](url)` 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.

Made by Toolora · 100% client-side · Updated 2026-06-13