April 5, 20252 min read

The complete Markdown guide

Digital illustration on a Markdown theme in a modern space setting, with a 3D notebook and the Markdown logo glowing over a cosmic blue and purple background.

Markdown is a lightweight markup language for formatting plain text documents. John Gruber created it in 2004 and today it’s everywhere: READMEs, documentation, notes, and blogs like this one, which is written entirely in Markdown.

Here’s a reference of the syntax to look up whenever you need it.

Basic syntax

Headings

# H1
## H2
### H3
#### H4
##### H5
###### H6

Emphasis

*Italic text* or _Italic text_
**Bold text** or __Bold text__
***Bold and italic*** or ___Bold and italic___
~~Strikethrough~~

Lists

Unordered lists

- First item
- Second item
- Third item
  - Nested item
  - Another nested item

Ordered lists

1. First item
2. Second item
3. Third item
   1. Nested item
   2. Another nested item
[Link text](https://www.example.com)
![Alt text](image.jpg)

Code

Inline code

Drop some `code` into your text

Code blocks

```javascript
const hello = "world";
console.log(hello);
```

Blockquotes

> This is a quote
> 
> And it can run across several lines

Horizontal rules

---
***
___

Extended syntax

None of this is part of the original Markdown, and not every editor supports it. Tables, task lists and footnotes work almost everywhere (GitHub, most site generators); emoji shortcodes and == highlighting depend heavily on the tool.

Tables

| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |

Task lists

- [x] Write the press release
- [ ] Update the website
- [ ] Reach out to the press

Footnotes

Here's a sentence with a footnote. [^1]

[^1]: And here's the footnote itself.

Emoji

:smile: :heart: :rocket:

Highlighting

==highlighted text==

Good habits

  1. Keep it simple: Markdown is meant to read well even without rendering.
  2. Be consistent: if you use - for lists, always use it; the same goes for * or _ for emphasis.
  3. Leave blank lines between blocks. Many formatting problems come from gluing a paragraph to a list or a heading.
  4. Keep headings in order: a single H1 and lower levels for subsections, without skipping levels.
  5. Escape special characters with a backslash (\*) when you want them to show as they are.

Common mistakes

  • Forgetting the space after the # in a heading
  • Getting the indentation wrong on nested lists
  • Mixing different list markers in the same list
  • Not escaping special characters when you need to

Tools and resources

The best way to learn it is to use it: after a few documents you’ll only need this guide for the extended syntax.

Share