Blog · Guide

Markdown Cheat Sheet: Complete Syntax Reference

May 31, 2026 · 10 min read
advertisement

This is the Markdown syntax reference you’ll want to bookmark. Every major element — from basic text formatting to tables and code blocks — with examples you can copy directly into your editor.


Headings

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

Use H1 for the document title. H2 for major sections. H3 for subsections. Most renderers style H4–H6 as smaller bold text.


Text Formatting

**Bold text**
*Italic text*
***Bold and italic***
~~Strikethrough~~
`Inline code`

Bold text**text** or __text__

Italic text*text* or _text_

Bold and italic***text***

Strikethrough~~text~~

Inline code — backticks around the text


Paragraphs and Line Breaks

First paragraph.

Second paragraph — separated by a blank line.

Line with a hard break  
(two trailing spaces before the newline)

A blank line creates a new paragraph. Two spaces at the end of a line force a line break without a new paragraph.


Lists

Unordered list — use -, *, or +:

- Item one
- Item two
  - Nested item
  - Another nested item
- Item three

Ordered list — use numbers:

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

The actual numbers don’t matter — 1. 1. 1. renders as 1. 2. 3.. But using sequential numbers is better for readability in source.

Task list (GitHub Flavored Markdown):

- [x] Completed task
- [ ] Incomplete task
- [ ] Another item

[Link text](https://example.com)
[Link with title](https://example.com "Tooltip text")
[Reference-style link][ref-id]

[ref-id]: https://example.com

Bare URLs are auto-linked in many parsers: https://example.com


Images

![Alt text](image.jpg)
![Alt text](image.jpg "Optional title")
![Reference image][img-ref]

[img-ref]: image.jpg

Alt text is required for accessibility. It describes the image for screen readers and appears when the image fails to load.


Code

Inline code:

Use `console.log()` to debug.

Fenced code block (with optional language):

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

Common language identifiers: javascript, python, bash, html, css, json, sql, markdown.

Indented code block (4 spaces or 1 tab — legacy syntax):

    function oldStyle() {
      return true;
    }

Fenced code blocks (triple backticks) are preferred over indented blocks.


Blockquotes

> Single-line quote

> Multi-line quote
> continues here
>
> Second paragraph in the same quote

>> Nested quote inside the outer one

Tables

| Column 1 | Column 2 | Column 3 |
| :------- | :------: | -------: |
| Left     | Center   |    Right |
| data     | data     |     data |

Alignment: :--- left, :---: center, ---: right.


Horizontal Rule

Three or more hyphens, asterisks, or underscores on their own line:

---
***
___

Escaping Special Characters

Backslash escapes any Markdown character:

\*Not italic\*
\# Not a heading
\`Not code\`

Characters that need escaping: \ * _ {} [] () # + - . !


HTML in Markdown

Most parsers allow raw HTML inline:

<strong>Bold via HTML</strong>
<em>Italic via HTML</em>
<br>
<mark>Highlighted text</mark>

Useful for elements Markdown doesn’t support natively (highlight, subscript, superscript, color).


Footnotes (Extended Syntax)

Here is a sentence with a footnote.[^1]

[^1]: This is the footnote text.

Supported in GitHub Flavored Markdown and most extended parsers (Pandoc, MultiMarkdown).


Definition Lists (Extended Syntax)

Term
: Definition of the term

Another term
: Its definition

Not universally supported — check your renderer.


Quick Reference Card

ElementSyntax
H1 heading# Title
H2 heading## Section
Bold**text**
Italic*text*
Bold italic***text***
Strikethrough~~text~~
Inline code`code`
Code block```lang
Link[text](url)
Image![alt](url)
Blockquote> text
Unordered list- item
Ordered list1. item
Table| col | col |
Horizontal rule---
Line breaktwo trailing spaces

Try Every Syntax Element

Paste any of these examples into Markdown Monk to see them rendered live and export to PDF, DOCX, or HTML instantly.

Free tool

Try it in the editor

Test every syntax example above — live in your browser, free, no sign-up.

Open editor → More guides →