Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

Markdown cheat sheet

On this page
  1. Headings
  2. Paragraphs and line breaks
  3. Emphasis
  4. Lists
    1. Unordered
    2. Ordered
    3. Task lists (GFM)
  5. Links
  6. Images
  7. Code
    1. Inline
    2. Fenced blocks
    3. Indented blocks (legacy)
  8. Blockquotes
  9. Tables (GFM)
  10. Horizontal rule
  11. Escaping
  12. Footnotes (GFM)
  13. HTML embeds
  14. Front matter (extension, not standard)
  15. What’s NOT in standard Markdown
  16. Rendering targets
  17. Syntax to memorize first
  18. Try it

Every Markdown syntax you’ll need, side by side with the rendered output. This page covers CommonMark (the standard) plus GitHub-Flavored Markdown (GFM) extensions — the same dialect rendered by GitHub, the viewer, and most modern Markdown processors.

For interactive testing, paste any of these examples into the viewer and watch them render.

Headings

# H1 — page title
## H2 — section
### H3 — subsection
#### H4
##### H5
###### H6

Use a single H1 per page. Skipping levels (H1 → H3) hurts readability and SEO; go through each level in order.

Don’t: add # characters with no space — #heading is a tag, not a heading.

Paragraphs and line breaks

First paragraph.

Second paragraph — a blank line separates them.

A line break in a single paragraph requires
two trailing spaces, or an explicit \  backslash.

In GFM (GitHub’s flavor), a single newline becomes a <br> automatically — no trailing spaces needed. The viewer follows GFM behavior.

Emphasis

**bold** or __bold__
*italic* or _italic_
***bold italic***
~~strikethrough~~  (GFM)

Convention: use * and _ consistently. Some teams prefer **bold** (asterisks) for bold and _italic_ (underscores) for italic to make the distinction visually obvious.

Lists

Unordered

- Item one
- Item two
  - Nested (2-space indent)
- Item three

Ordered

1. First
2. Second
3. Third

The numbers don’t have to be sequential — Markdown auto-numbers them. Many authors write 1. for every line and let the renderer count.

Task lists (GFM)

- [x] Done
- [ ] Pending
- [ ] Also pending

Renders as checkboxes; usable as a TODO format in READMEs and issues.

[Inline link](https://tooljo.com)
[Title attribute](https://tooljo.com "tooljo home")

<https://tooljo.com>          ← autolink
https://tooljo.com            ← autolink (GFM)

[Reference link][ref]
[Implicit reference][]

[ref]: https://tooljo.com
[Implicit reference]: https://tooljo.com

For long links repeated multiple times, reference-style keeps the prose clean. The reference definitions can go anywhere in the document.

Images

![Alt text](https://example.com/image.png)
![Alt text](image.png "Optional title")
[![Linked image](image.png)](https://example.com)

Always include alt text — it’s the SEO and accessibility signal. Reference-style works for images too:

![Logo][logo]

[logo]: assets/logo.svg "Company logo"

Code

Inline

Use the `format` function — backticks make code spans.

Fenced blocks

```js
function greet(name) {
  return `Hello, ${name}!`;
}
```

The language hint (js, python, rust, bash, etc.) enables syntax highlighting in renderers that support it. GitHub recognizes 600+ languages; most renderers know the popular dozen.

Indented blocks (legacy)

    Indented 4 spaces.
    Becomes a code block.

Avoid in new content — fenced blocks are clearer and let you specify a language.

Blockquotes

> A single-line quote.

> A multi-line quote.
> Continued on the next line.
>
> > Nested quote (use multiple `>`).

Tables (GFM)

| Column | Type | Notes |
|---|---|---|
| id | uuid | primary key |
| email | text | unique |

| Left | Center | Right |
|:-----|:------:|------:|
| L | C | R |

The : in the divider row sets alignment. Cells don’t have to line up visually in the source — the renderer normalizes them.

Horizontal rule

---
***
___

Three of any of these on their own line. --- is most common.

Escaping

Use \ to escape a Markdown character:

\*not italic\*
\# not a heading
\[not a link\](nowhere)

Inside code spans and code blocks, no escaping needed — content is verbatim.

Footnotes (GFM)

Here's a claim[^1] and another[^longer-name].

[^1]: First footnote.
[^longer-name]: A footnote with a more readable identifier.

Renders as superscript references with a list at the bottom.

HTML embeds

Markdown lets you embed raw HTML. Common useful cases:

<details>
  <summary>Click to expand</summary>
  Hidden content here.
</details>

<kbd>Cmd</kbd>+<kbd>K</kbd>

<sub>subscript</sub> and <sup>superscript</sup>

The viewer sanitizes the rendered HTML, so embedded <script> or event handlers are stripped — safe to render untrusted markdown.

Front matter (extension, not standard)

Many static-site generators (Jekyll, Hugo, Astro, Gatsby) support YAML or TOML front matter at the top of a Markdown file:

---
title: Hello
date: 2026-04-26
tags: [intro, demo]
---

# Hello world

This is not part of CommonMark or GFM. Renderers that don’t support it show the front matter as a literal --- rule and a list. Strip it before pasting into a generic Markdown viewer.

What’s NOT in standard Markdown

These are common requests that need extensions or a non-standard flavor:

FeatureWhere it worksWhere it doesn’t
UnderlineHTML <u> onlyMarkdown has no syntax
ColorHTML <span style>Markdown has no syntax
Centered textHTML <div align>Standard Markdown
MathKaTeX (extension)CommonMark / GFM
Mermaid diagramsGitHub, mdBook (extension)CommonMark / GFM
Highlighting==text== in some flavorsCommonMark / GFM
Definition listsPandoc, MultiMarkdownGFM
AbbreviationsMarkdown ExtraGFM

When you need these, either embed HTML directly or pick a flavor that supports them (Pandoc Markdown, MultiMarkdown, AsciiDoc).

Rendering targets

The same Markdown source renders slightly differently across:

If a snippet renders fine here but not on the target platform, the issue is almost always (a) a non-standard extension or (b) the platform’s sanitization stripping HTML.

Syntax to memorize first

If you only learn five things:

  1. # H1, ## H2 for structure.
  2. **bold**, *italic* for emphasis.
  3. - item for lists.
  4. [text](url) for links.
  5. ``` (triple backticks) for code blocks.

Everything else, look up here as needed.

Try it