Markdown cheat sheet: every syntax you need (2026)
A Markdown cheat sheet with every common syntax: headings, lists, links, code, tables and task lists, and which parts are CommonMark or GitHub-flavored.
Markdown is plain text with a few symbols: # makes a heading, **bold** makes bold text, - starts a list, [text](url) makes a link and backticks make code. This cheat sheet lists every common syntax with an example, and it marks which parts are standard CommonMark and which come from GitHub Flavored Markdown (GFM). Loam is our app, a free and open source Markdown notebook for macOS, and it reads CommonMark with the GFM extensions.
The Markdown syntax cheat sheet
Copy from this table, then read the section for the syntax you need. Rows marked GFM work on GitHub and in any app that supports GitHub Flavored Markdown.
| Element | Syntax | Result |
|---|---|---|
| Heading | # Heading 1 to ###### Heading 6 | A heading, from the largest level to the smallest |
| Bold | **bold** | Bold text |
| Italic | *italic* or _italic_ | Italic text |
| Strikethrough (GFM) | ~~struck~~ | Text with a line through it |
| Bulleted list | - Item | A list with bullets |
| Numbered list | 1. Item | A list with numbers |
| Task list (GFM) | - [ ] To do and - [x] Done | An open box and a checked box |
| Link | [label](https://example.com) | A clickable link |
| Image |  | An image, with alt text for screen readers |
| Inline code | One backtick on each side of the text | Text in a monospace font |
| Code block | Three backticks, an optional language name, the code, three backticks | A block of code, with highlighting where the app supports it |
| Block quote | > Quote | An indented quotation |
| Horizontal rule | --- | A line across the page |
| Table (GFM) | | Name | Role | | A table, with a row of hyphens under the header row |
| Footnote (GitHub) | [^1] and [^1]: Text | A numbered note at the bottom of the page |
Syntax checked against the CommonMark quick reference and GitHub's formatting docs on 2026-11-03.
How do you write headings in Markdown?
Start the line with one to six # characters and a space. One # is the top level and six is the smallest. CommonMark also accepts an underline of equals signs (level 1) or hyphens (level 2) under the text, but the # form is the one most people use.
# Project plan
## Goals
### Open questionsOn GitHub every heading is also a link target. [Goals](#goals) jumps to the ## Goals heading in the same file, because GitHub lowercases the heading and replaces spaces with hyphens.
How do you make text bold, italic or struck through?
Wrap the text in asterisks or underscores. One pair makes italic, two pairs make bold, and three pairs make both. Strikethrough uses two tildes and comes from GFM, so original Markdown and plain CommonMark have no syntax for it.
| Style | Syntax | Defined in |
|---|---|---|
| Italic | *text* or _text_ | CommonMark |
| Bold | **text** or __text__ | CommonMark |
| Bold and italic | ***text*** | CommonMark |
| Strikethrough | ~~text~~ | GFM |
GitHub also accepts a single tilde for strikethrough, but the double form is the safer choice. To show a symbol such as an asterisk without formatting, put a backslash before it: \*.
How do lists and task lists work in Markdown?
Start a line with -, * or + for a bulleted list, or with a number and a period for a numbered one. Indent a line under the text of its parent to nest it. A task list is a bulleted list where each item starts with [ ] for an open task or [x] for a done one, and it is a GFM feature.
- Apples
- Oranges
- Blood oranges
1. Wake up
2. Write notes
- [ ] Draft the plan
- [x] Send the planHow do you add links and images?
A link is the label in square brackets followed by the address in parentheses. An image is the same thing with a ! in front, and the label becomes the alt text. CommonMark also has reference links, where the address is defined once on its own line. GFM turns a bare web address into a link without any syntax.
[Loam docs](https://example.com/docs)
[Loam docs][1]
[1]: https://example.com/docs

<https://example.com>Relative links point to other files. On GitHub, [Guidelines](docs/CONTRIBUTING.md) opens a file in the same repository, and the same idea links one note to another in a folder of notes.
How do you format code and block quotes?
Put one backtick on each side of a short piece of code. For a block, put three backticks on the line before and the line after, and add a language name after the first three to get syntax highlighting. CommonMark also treats a block indented by four spaces as code. A line that starts with > is a block quote.
Run `npm test` before you push.
```bash
npm test
```
> Notes are plain text files.
> Any editor can open them.GitHub adds alerts on top of block quotes. A quote whose first line is > [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING] or > [!CAUTION] renders as a colored callout on GitHub. An app without alert support shows it as an ordinary quote, so the text stays readable.
How do you write a table in Markdown?
Separate the columns with pipes, and put a row of hyphens under the header row. Colons in that row set the alignment: :--- is left, :---: is centered and ---: is right. Leave a blank line before the table, or it will not render. Tables are a GFM extension, so they are not part of CommonMark.
| Item | Qty | Price |
| :----- | :---: | ----: |
| Widget | 2 | 4.50 |
| Gadget | 10 | 1.25 |Use at least three hyphens in each column of the separator row. Links, code, bold and italic text all work inside cells. A pipe that should appear as text needs a backslash in front of it, or it ends the cell.
Rules, line breaks and footnotes
Three or more --- or *** on a line of their own draw a horizontal rule. Leave a blank line above ---, because directly under a line of text it turns that line into a level 2 heading. A single newline inside a paragraph does not start a new line. To force one, end the line with two spaces or a backslash, or leave a blank line for a new paragraph.
A footnote has two parts: a marker such as [^1] in the text, and a definition such as [^1]: Footnote text. anywhere in the file. GitHub renders the definitions at the bottom of the page, but not in wikis. Neither the CommonMark spec nor the GFM extension list includes footnotes, so test them in your tool before you rely on them.
First line\
Second line
---
Markdown is portable.[^1]
[^1]: A footnote can be defined anywhere in the file.CommonMark, GFM and original Markdown: what differs?
John Gruber wrote the original Markdown syntax description. It leaves details open, so apps rendered the same file in different ways. CommonMark is a strict specification of the core syntax, and its current version is 0.31.2. GFM is CommonMark plus a few extensions, and its spec (version 0.29-gfm) lists tables, task list items, strikethrough, autolinks and disallowed raw HTML. Tables, task lists and strikethrough are GFM extensions, so an app that only reads CommonMark may show them as plain text.
| Syntax | Original Markdown | CommonMark | GFM |
|---|---|---|---|
| Headings, emphasis, links, images, block quotes | Yes | Yes | Yes |
| Lists and horizontal rules | Yes | Yes | Yes |
| Fenced code blocks | No, indented code only | Yes | Yes |
| Tables | No | No | Yes |
| Task lists | No | No | Yes |
| Strikethrough | No | No | Yes |
| Bare web addresses as links | No | No | Yes |
| Footnotes | No | No | Not in the spec; GitHub renders them |
Alerts such as > [!NOTE] | No | No | Not in the spec; a GitHub feature |
From the original syntax page, the CommonMark spec and the GFM spec, read on 2026-11-03.
Sources: CommonMark: quick reference โ ยท CommonMark specification โ ยท GitHub Flavored Markdown spec โ ยท GitHub Docs: basic writing and formatting syntax โ ยท GitHub Docs: organizing information with tables โ ยท Daring Fireball: Markdown syntax documentation โ
What does Loam read, and what does it add?
Loam reads CommonMark with the GFM extensions: headings, lists, tables, task lists and code blocks. It also reads YAML frontmatter, the properties between two --- lines at the top of a note, and links to notes. On top of that, Loam reads a few conventions that live in plain text on the line, so the note stays a normal Markdown file.
---
status: doing
created: 2026-10-28
tags: [project, work]
---
# Plan
- [ ] Ship the beta ๐
2026-11-20 #work โซ
- [x] Write the plan โ
2026-10-17| You write | Loam reads it as |
|---|---|
๐
2026-11-20 or due:2026-11-20 | The due date of a task |
โซ or !high | High priority |
๐ฝ or !low | Low priority |
โ
2026-10-17 | The date a task was done; Loam writes it when you check the task |
#work or #work/calls | A tag; a filter on #work also finds #work/calls |
tags: [project, work] | Tags in the frontmatter; both forms count |
@tomorrow or @fri | Typed in a note, it writes the due date for you |
From the Loam docs: Write and organize notes, and Tasks.
Loam also keeps callouts in the GitHub alert form. When you import an Obsidian vault, its callouts become GitHub alerts such as > [!NOTE], so the notes read the same on GitHub. The importer is described in Import notes.
Does Markdown work the same in every app?
The core syntax does. A Markdown note is a .md text file, so Loam, Obsidian, GitHub and a terminal can all open the same file. What differs is how each app renders the extensions, such as footnotes or alerts. For notes you want to keep for years, stay with CommonMark and GFM, the two forms that most tools agree on.
That portability is the reason Loam stores every note as Markdown. Why Markdown is still the right format covers the argument, and Best Markdown editors for Mac compares the apps that edit these files.
Try Loam
Loam is free and open source. One command installs it, as described in Install Loam, and you can open any folder of Markdown files as a vault, as shown in Your first vault. Loam runs on macOS 26 or later, on Apple silicon, and has no iPhone or Android app. To see how it sits next to a dedicated Markdown editor, read Loam vs Typora, or browse all comparisons.