Skip to main content

Markdown Reference Cheatsheet 2025

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Markdown is a lightweight markup language that allows you to format plain text. It is widely used for documentation, writing articles, and creating web content.

Headings

Use # to create headings. The number of # corresponds to the heading level.

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

Text Formatting

  • Bold: Use two asterisks or two underscores.

    **This is bold text**
    __This is also bold text__
  • Italic: Use a single asterisk or a single underscore.

    *This is italic text*
    _This is also italic text_
  • Bold and Italic: Combine both.

    ***This is bold and italic text***
    ___This is also bold and italic text___
  • Strikethrough: Use two tildes.

    ~~This is strikethrough text~~

Lists

  • Unordered List: Use asterisks, plus signs, or hyphens.

    * Item 1
    * Item 2
    * Sub-item 2a
    * Sub-item 2b
  • Ordered List: Use numbers followed by a period.

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

    Markdown is flexible; you can use 1. for all items, and it will still render correctly.

    1. First item
    1. Second item
    1. Third item

  • Link: Enclose the link text in square brackets and the URL in parentheses.

    [Link Text](https://www.example.com)
  • Image: Similar to a link, but with an exclamation mark at the beginning.

    ![Alt Text](https://www.example.com/image.jpg)

Code

  • Inline Code: Use a single backtick.

    This is `inline code`.
  • Code Block: Use three backticks for a multi-line code block. You can specify the language for syntax highlighting.

    ```python
    def hello_world():
    print("Hello, World!")

Blockquotes

Use a right angle bracket (>) for a blockquote.

> This is a blockquote.
> It can span multiple lines.

Horizontal Rule

Use three or more hyphens, asterisks, or underscores on a line by themselves.

---
***
___

Tables

You can create tables by using hyphens for the column headers and pipes (|) to separate columns.

| Header 1 | Header 2 |
|----------|----------|
| Row 1 Col 1 | Row 1 Col 2 |
| Row 2 Col 1 | Row 2 Col 2 |

You can also align text within columns by adding colons to the header line.

| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| Content | Content | Content |

The Complete CommonMark Cheatsheet

SyntaxDescriptionExample
# HeadingHeadings (levels 1-6)# My Heading
> BlockquoteBlockquote> This is a quote.
1. ItemOrdered List1. First item<br />2. Second item
- ItemUnordered List- First item<br />- Second item
---Horizontal Rule--- or ***
```python
code
Fenced Code Block```python
print("Hello World")
**bold**Strong Emphasis (bold)**text**
*italic*Emphasis (italic)*text*
`code`Inline Code`code`
[text](url)Link[Google](https://google.com)
![alt](url)Image![My Image](image.png)
~~strike~~Strikethrough~~text~~
``a | b | <br />---
[foo]
[foo]: /url "title"
Reference-style Link[ref-link]
[ref-link]: /my-page
<http://example.com>Autolink<http://example.com>
\Backslash Escapes\*not italic\*
&gt;HTML Entities&gt; will render as >
foo

bar
Paragraphs (separated by a blank line)line one

line two