Garmr
Menu
Cheatsheets
markdown logo

Markdown

September 30, 2026 · 4 min read

On this page

๐Ÿ“ Basic Syntax

Works in virtually every Markdown renderer.

๐Ÿ”ค Text

Headings

Creates titles and section headers (1 = largest, 6 = smallest)

# Heading 1         page title
## Heading 2        main section
### Heading 3       subsection
#### Heading 4      ...down to ###### Heading 6
  alt.              Heading 1        (underline with = or -)
                    =========
  e.g.              ## Installation

Paragraphs & line breaks

Separates blocks of text

(blank line)        starts a new paragraph
two spaces + Enter  line break inside a paragraph
<br>                line break (HTML, always works)
  e.g.              First lineยทยท
                    Second line       (ยทยท = two spaces)

Emphasis

Makes text bold, italic, or both

*text*  _text_          italic
**text**  __text__      bold
***text***              bold + italic
  e.g.                  This is **very** *important*

Blockquotes

Quotes or highlights a block of text

> text              quote
>> text             nested quote
> - item            other elements work inside quotes
  e.g.              > Talk is cheap. Show me the code.

๐Ÿ“‹ Lists

Unordered lists

Creates bullet points

- item              bullet (also * or +)
  - item            nested bullet (indent 2โ€“4 spaces)
  e.g.              - Milk
                    - Eggs
                      - Free-range

Ordered lists

Creates numbered lists

1. item             numbered item
1. item             numbers auto-increment, so 1. 1. 1. works
   1. item          nested (indent to align with text)
  e.g.              1. Clone the repo
                    2. Install dependencies

๐Ÿ’ป Code

Inline code

Formats code inside a sentence

`code`              inline code
`` code with ` ``   use double backticks if code contains `
  e.g.              Run `ls -la` to see hidden files

Indented code blocks

Creates a code block without fences

    code            indent every line with 4 spaces
  e.g.                  echo "hello"

Links

Creates clickable links

[text](url)                 basic link
[text](url "title")         link with hover title
<https://example.com>       auto-link a raw URL
[text](#heading-name)       link to a heading on the same page
  e.g.                      [Docs](https://example.com/docs)

Reference links

Keeps long URLs out of the text

[text][id]                  link using a reference
[id]: url                   define the reference (anywhere in file)
  e.g.                      Read the [guide][1].
                            [1]: https://example.com/guide

Images

Embeds an image

![alt text](url)            image (alt text = description)
![alt](url "title")         image with hover title
[![alt](img)](url)          clickable image
  e.g.                      ![Logo](./images/logo.png)

๐Ÿงฑ Structure

Horizontal rule

Draws a dividing line

---                 horizontal line (also *** or ___)
                    leave a blank line above, or --- turns
                    the text above into a heading

Escaping characters

Shows Markdown symbols as plain text

\*                  backslash before the symbol
  escapable         \ ` * _ { } [ ] ( ) # + - . ! |
  e.g.              \*not italic\*

๐Ÿงฉ Extended Syntax

Supported by GitHub (GFM, GitHub Flavored Markdown) and most modern editors, but not every renderer.

๐Ÿ”ค Text

Strikethrough

Crosses out text

~~text~~            strikethrough
  e.g.              ~~$50~~ $30

Emoji

Inserts emoji by name

:name:              emoji shortcode
  e.g.              :rocket:  :white_check_mark:  :warning:
                    (or just paste the emoji directly ๐Ÿš€)

Footnotes

Adds a numbered note at the bottom of the page

text[^1]            footnote reference
[^1]: note          footnote content (anywhere in file)
  e.g.              Linux was released in 1991[^1].
                    [^1]: By Linus Torvalds.

๐Ÿ’ป Code

Fenced code blocks

Creates a code block with syntax highlighting

```lang             open block + language name
code
```                 close block
~~~                 tildes also work as fences
  langs             bash, python, js, json, html, css, sql, diff...
  e.g.              ```python
                    print("hello")
                    ```

Diff blocks

Shows added and removed lines in color

```diff
+ line              added line (green)
- line              removed line (red)
```

๐Ÿ“Š Tables

Tables

Organizes data in rows and columns

| A | B |           header row
|---|---|           separator (required)
| 1 | 2 |           data row
  :---              align left
  :---:             align center
  ---:              align right
  \|                pipe character inside a cell
  e.g.              | Name  | Price |
                    |:------|------:|
                    | Apple |  $1.00|

โœ… Lists

Task lists

Creates checkboxes

- [ ] task          unchecked
- [x] task          checked
  e.g.              - [x] Write docs
                    - [ ] Publish

๐Ÿงฐ Extras

Alerts

Creates colored callout boxes (GitHub)

> [!NOTE]           blue, useful info
> [!TIP]            green, helpful advice
> [!IMPORTANT]      purple, key info
> [!WARNING]        yellow, needs attention
> [!CAUTION]        red, risky action
  e.g.              > [!WARNING]
                    > This deletes all data.

Collapsible sections

Hides content until clicked (HTML)

<details>
<summary>Title</summary>      clickable label

content                       leave blank lines around Markdown
</details>

Math

Renders formulas with LaTeX (GitHub, Obsidian, many editors)

$x^2$               inline math
$$                  block math
x = \frac{a}{b}
$$

Diagrams

Draws diagrams from text with Mermaid (GitHub, Obsidian, many editors)

```mermaid
graph LR
  A[Start] --> B[End]
```

Comments

Hides text from the rendered output

<!-- text -->       HTML comment, invisible when rendered
  e.g.              <!-- TODO: add screenshots -->

Inline HTML

Uses HTML when Markdown can't do it

<kbd>Ctrl</kbd>         keyboard key
<sup>2</sup>            superscript
<sub>2</sub>            subscript
<mark>text</mark>       highlight
<img src="" width="200">  image with custom size