# Markdown cheat sheet

A practical Markdown reference from [Ariv](https://ariv.one/markdown-cheat-sheet/).

Core examples follow [CommonMark](https://spec.commonmark.org/). Tables, task lists, strikethrough and extended autolinks are GitHub Flavored Markdown extensions. Renderer support can vary.

## Quick reference

### Headings

```markdown
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
```

### Emphasis

```markdown
**bold**
*italic*
***bold and italic***
```

Strikethrough is a GitHub Flavored Markdown extension:

```markdown
~~removed~~
```

### Links and images

```markdown
[Link text](https://example.com)
![Image description](image.png "Optional title")
```

Reference-style links are useful when the same URL appears several times:

```markdown
Read the [CommonMark specification][commonmark].

[commonmark]: https://spec.commonmark.org/
```

### Blockquotes

```markdown
> Quoted text
>
> A second paragraph in the same quote.
```

### Bullet lists

```markdown
- First item
- Second item
  - Nested item
  - Another nested item
```

### Numbered lists

```markdown
1. First item
2. Second item
3. Third item
```

### Task lists

Task lists are a GitHub Flavored Markdown extension:

```markdown
- [x] Complete item
- [ ] Open item
```

### Inline code

```markdown
Run `npm test` before shipping.
```

Use a longer backtick delimiter when the code itself contains a backtick:

```markdown
Use `` `code with a backtick` `` when needed.
```

### Fenced code blocks

````markdown
```js
const ready = true;
console.log(ready);
```
````

The language name is an info string. Syntax highlighting depends on the renderer.

### Horizontal rule

```markdown
---
```

Put the three hyphens on a line by themselves. Asterisks or underscores can also form a thematic break.

### Paragraphs and line breaks

Use a blank line for a new paragraph:

```markdown
This is one paragraph.

This is a second paragraph.
```

For a hard line break inside the same paragraph, end the first line with a backslash or at least two spaces:

```markdown
First line.\
Second line.
```

### Tables

Tables are a GitHub Flavored Markdown extension:

```markdown
| Item | Owner | Status |
| :--- | :---: | ---: |
| Guide | Maya | Ready |
| Demo | Lee | Draft |
```

Colons in the delimiter row request left, center or right alignment. Some renderers ignore alignment.

### Escaping Markdown punctuation

Use a backslash when punctuation should stay literal:

```markdown
\*literal asterisks\*
\# not a heading
\[not a link\]
```

### Comments

Markdown has no dedicated comment syntax. Many renderers accept HTML comments:

```markdown
Visible paragraph.

<!-- This note is hidden in many renderers. -->

Another visible paragraph.
```

HTML filtering and export behavior vary, so comments are renderer-dependent.

### Centering text and images

Markdown has no portable centering syntax. Some readers accept raw HTML:

```html
<p align="center">
  Centered text
</p>

<p align="center">
  <img src="logo.png" alt="Project logo">
</p>
```

This works only when the reader accepts and preserves the raw HTML. An app may sanitize or ignore the HTML or the `align` attribute, so check the destination before relying on it.

## Manual table of contents

Core Markdown has no automatic table-of-contents command. Some apps generate one from headings. A manual version uses ordinary links:

```markdown
## Contents

- [Getting started](#getting-started)
- [Next steps](#next-steps)
```

Heading anchor rules vary between renderers. Check the destination before relying on a manual table of contents.

## Portability guide

### Portable CommonMark core

- Headings and paragraphs
- Emphasis and strong emphasis
- Links and images
- Blockquotes and lists
- Inline and fenced code
- Hard line breaks and thematic breaks

### Common GitHub Flavored Markdown extensions

- Tables
- Task-list items
- Strikethrough
- Extended autolinks
- Filtering of some raw HTML

### Renderer-specific features to check

- Wikilinks such as `[[Note]]`
- Automatic tables of contents
- Heading anchor rules
- Footnotes, callouts and diagrams
- Raw HTML and HTML comments
- Frontmatter interpretation

## Complete example

````markdown
# Launch checklist

**Goal:** Publish a useful guide without losing accuracy.

## Before publishing

- [x] Check the primary sources
- [x] Test every example
- [ ] Review the mobile layout
- [ ] Confirm the canonical URL

## Notes

> The page should be useful before it asks for anything.

Read the [CommonMark specification](https://spec.commonmark.org/)
and the [GFM specification](https://github.github.com/gfm/).

```sh
npm test
```

---

Updated: 2026-08-11
````

## Primary sources

- [CommonMark specification](https://spec.commonmark.org/)
- [GitHub Flavored Markdown specification](https://github.github.com/gfm/)
- [GitHub basic writing and formatting syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)

## Use Markdown for real work

Ariv works directly with a folder of Markdown files and adds capture, search, tasks, Kanban, backlinks and optional AI around them. The files remain readable outside the app.

- [Local-first Markdown notes](https://ariv.one/local-first-markdown-notes/)
- [Markdown task manager](https://ariv.one/markdown-task-manager/)
