Markdown cheat sheet: syntax on one page
Bobby Huang ·
Markdown formats plain text with a few symbols. Type # and a space for a heading, *word* for italic, **word** for bold, - for a bullet, 1. for a numbered item, [text](url) for a link and  for an image. Backticks mark code, > starts a quote, and pipes with a dash row build a table. Tables, task lists, strikethrough and bare-URL links come from GFM, so tools without GFM show them as plain text. Common causes of rendering problems are a missing blank line, a missing space, or a symbol read as formatting.
Key takeaways
- Core Markdown covers headings, emphasis, lists, links, images, code, quotes and rules, and renders the same almost everywhere.
- Tables, task lists, strikethrough and bare-URL links are GFM extensions, so tools without GFM show the raw symbols.
- A space after the marker and a blank line before a block fix common rendering problems.
- A table needs the same number of cells in its header row and its delimiter row, or it is not a table at all.
- Sashmark is in development and not released; rendering the core elements on this page, including local images, is planned for v1.
This Markdown cheat sheet puts the common syntax on one page. Each row shows what you type on the left and what you get on the right, so you can find one element and copy it in seconds. If the file format itself is new to you, start with what a .md file is.
The sheet keeps explanations to a minimum. For the why behind each element, see the Markdown syntax guide. Rows marked (GFM) need a tool with GFM support; tools without it show those as plain text.
Text
| You type | You get |
|---|---|
*italic* or _italic_ |
italic text |
**bold** or __bold__ |
bold text |
~~struck~~ |
struck-through text (GFM) |
line one\ then a new line |
a line break inside the paragraph |
\*not italic\* |
the asterisks as plain text |
A blank line starts a new paragraph. A single line break inside a paragraph is joined with a space:
These two lines
render as one line.
This is a new paragraph.
Two spaces at the end of a line also force a line break, but they are invisible in the raw file, so the backslash is easier to spot.
Headings
| You type | You get |
|---|---|
# Heading |
top-level heading |
## Heading |
second-level heading |
### Heading |
third-level heading |
###### Heading |
sixth level, the smallest |
#Heading |
plain text (no space after the #) |
\# not a heading |
a hash sign as text |
Older files sometimes underline the top two levels instead:
Top-level heading
=================
Second-level heading
--------------------
Lists
| You type | You get |
|---|---|
- item |
bullet list item |
* item or + item |
bullet list item (switching markers starts a new list) |
1. item |
numbered list item |
1. on every line |
still numbered 1, 2, 3 |
- [ ] task |
open check box (GFM) |
- [x] task or - [X] task |
ticked check box (GFM) |
1. [ ] step |
numbered check box (GFM) |
Nest a child item so its marker lines up with the parent's text: two spaces under - , three under 1. .
- Check the steps
- Look at file paths
- [ ] Confirm the commands
1. Open the file
- Read the header
Rules for check boxes, and a way to count open ones from the terminal, are in Markdown task lists.
Links and images
| You type | You get |
|---|---|
[Example](https://www.example.com/) |
a link named Example |
[Plan](notes/plan.md "Tip") |
a link with a tooltip that reads Tip |
<https://www.example.com> |
the address as a link |
https://www.example.com |
the bare address as a link (GFM) |
 |
an image with alt text |
A relative path such as notes/plan.md is read from the folder the Markdown file sits in.
Reference links keep long text clean. The definition line does not show on the page:
See the [setup notes][setup].
[setup]: docs/setup.md
Code
| You type | You get |
|---|---|
| three backticks on a line, code, three backticks | a code block |
| a language name after the opening backticks | syntax highlighting where the tool supports it |
~~~ before and after |
a code block, same as backticks |
| every line indented four spaces | an older code block with no language |
Inline code and a fenced block:
Run `pnpm test` before you merge.
```bash
pnpm install
pnpm test
```
Block quotes
| You type | You get |
|---|---|
> text |
a quoted block |
> on its own |
a blank line inside the quote |
> > text |
a quote nested inside a quote |
> The agent stopped here.
>
> > Waiting on Jane Doe for the key.
Tables
| You type | You get |
|---|---|
| a header row of cells split by pipes | the column headings (GFM) |
--- | --- under the header |
the delimiter row, one cell per column (GFM) |
:--- |
left-aligned column |
---: |
right-aligned column |
:---: |
centered column |
A full table:
| File | Lines | Status |
| :------- | ----: | :-----: |
| plan.md | 120 | changed |
| notes.md | 8 | new |
To put a pipe inside a cell, escape it with a backslash, including inside inline code:
| Command | Meaning |
| --- | --- |
| `a \| b` | send a into b |
Pipes don't need to line up. Cells hold inline text only, one line each, with no merged cells. The rules and fixes are in Markdown tables.
Other
| You type | You get |
|---|---|
--- with a blank line above |
a line across the page |
*** or ___ on their own line |
a line across the page |
\ before an ASCII punctuation character |
that character as plain text |
| an HTML tag | depends on the tool: rendered, stripped or shown as text |
A YAML block between two --- lines at the very top of a file is front matter. It is not part of core Markdown or GFM.
Common slips
- No blank line before a list. A numbered list that starts at 2 or higher joins the paragraph above.
- No space after the marker.
#Headingand-itemstay plain text. - An empty box.
- []with nothing inside the brackets is not a task. Use- [ ]. - Cell counts that differ. If the header row and the delimiter row have a different number of cells, the table does not render.
- A blank line inside a table. The table ends there, and the rest shows as text with pipes.
- A symbol read as formatting. An asterisk or underscore at the edge of a word, as in a pattern like
*.md, can start italics. Wrap it in backticks or escape it. - Dashes right under text.
---with no blank line above turns the line above into a heading.
When a page looks off, read the raw text first. The cause is usually a space, a blank line or an escape.
Where Sashmark fits
Sashmark is a Markdown reader and editor for people whose AI agents write Markdown, being built for Mac, Windows and Linux. It is in development and has not been released, and the app has no AI features of its own.
A good reader should render the core elements on this page cleanly, so you rarely need a cheat sheet to read a file, only to write one. Sashmark is being built for this; the roadmap shows where it stands. Rendering headings, lists, check-box lists, tables, code blocks, links, local images and block quotes is planned for v1. See the planned features for the full list.
Sashmark is in development. See what it is at sashmark.com.
Questions
- How do I start a new line without starting a new paragraph?
- End the line with a backslash or with two spaces. A single line break inside a paragraph is joined into one line, and a blank line starts a new paragraph.
- Why do some elements on the cheat sheet show as plain text in my tool?
- Tables, task lists, strikethrough and bare-URL links are GFM extensions. A tool without GFM support shows the pipes, brackets and tildes as text. Core elements such as headings, lists and links render almost everywhere.
- How do I show a Markdown symbol as plain text?
- Put a backslash in front of it. For example, \* shows an asterisk instead of starting italics, and \# at the start of a line shows a hash sign instead of a heading. Inside backticks, symbols already show as text.