Markdown Syntax Cheatsheet: Essential Guide & Example

So, you’re ready to dive into markdown? Excellent choice!

As you might have read in our guide to what markdown is, its beauty lies in simplicity and readability.

This cheatsheet is designed to be your quick companion. Whether you’re writing notes, documentation or even preparing text for LLMs.

Bookmark it, keep it handy, and you’ll be formatting text like a pro in no time.

We’ll cover the most essential syntax you’ll use every day.

Let’s get started!

Headings: giving structure to your content

Headings organize your document and create a clear hierarchy.

You create them using hash symbols (#) at the start of the line.

The number of hashes corresponds to the heading level (H1 being the largest, H6 the smallest).

syntax:

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

How it looks (typically):

Heading level 1

Heading level 2

Heading level 3

Heading level 4

Heading level 5
Heading level 6

Emphasis: making text stand out

You can easily make text italic or bold.

italics:
Wrap text with one asterisk (*) or one underscore (_).

*This text will be italic.*
_This text will also be italic._

how it looks:
This text will be italic.
This text will also be italic.

bold:
Wrap text with two asterisks (**) or two underscores (__).

**This text will be bold.**
__This text will also be bold.__

how it looks:
This text will be bold.
This text will also be bold.

bold and italic:
Combine them using three asterisks or underscores.

***This text will be bold and italic.***
___This text will also be bold and italic.___

how it looks:
This text will be bold and italic.
This text will also be bold and italic.


Lists: organizing items clearly

Markdown handles both unordered (bulleted) and ordered (numbered) lists with ease.

unordered lists:
Use asterisks (*), plus signs (+), or hyphens (-) interchangeably.

* Item 1
* Item 2
  * Sub-item 2a (indent for nesting)
  * Sub-item 2b

- Another main item
+ And one more

how it looks:

  • Item 1
  • Item 2
    • Sub-item 2a
    • Sub-item 2b
  • Another main item
  • And one more

ordered lists:
Simply use numbers followed by a period.

1. First item
2. Second item
3. Third item
   1. Sub-item 3a (nesting works here too!)
   2. Sub-item 3b

how it looks:

  1. First item
  2. Second item
  3. Third item
    1. Sub-item 3a
    2. Sub-item 3b

(The actual numbers you use don’t strictly have to be sequential for the HTML to render correctly, but it’s good practice for readability of your raw markdown.)


Visual guide to creating links and inserting images with Markdown syntax.

Links: connecting to other places

Creating hyperlinks is straightforward.

syntax:
[Text you want to display for the link](https://www.your-url-here.com)

example:
Visit [CopyMarkdown.com](https://copymarkdown.com) for easy URL to Markdown conversion.

how it looks:
Visit CopyMarkdown.com for easy URL to Markdown conversion.

You can also add an optional title that appears on hover:
[Link Text](https://www.your-url-here.com "Optional link title")


Images: adding visuals

Images use a similar syntax to links, but with an exclamation mark (!) at the beginning.

syntax:
![Alt text for the image](https://www.example.com/path/to/your/image.jpg)

The “alt text” is important for accessibility (for screen readers) and will display if the image fails to load.

example:
![A cute cat](https://placekitten.com/200/300)

how it looks (this will try to render an image):
A cute cat


Blockquotes: highlighting quoted text

To indicate a quote, use the greater-than symbol (>) at the start of the line.

syntax:

> This is a blockquote.
> It can span multiple lines if you start each line with the symbol.
>
> You can also have > nested blockquotes > by adding more symbols.

how it looks:

This is a blockquote.
It can span multiple lines if you start each line with the symbol.

You can also have > nested blockquotes > by adding more symbols.


Code: sharing snippets and commands

Markdown is great for displaying code.

inline code:
Wrap a small piece of code with single backticks (`).
syntax:
Use theprintf()function for output.
how it looks:
Use the printf() function for output.

fenced code blocks:
For longer blocks of code, use triple backticks () before and after the code block. You can also specify the programming language for syntax highlighting in many markdown renderers. This is also how tools that convert an entire repo to Markdown keep code readable for LLMs. That same structure matters beyond code: our context engineering guide covers how to shape a whole page into clean context an AI agent can actually use.

syntax:

```python
def greet(name):
  print(f"Hello, {name}!")

greet("Markdown User")
```

how it looks (syntax highlighting depends on your website’s setup):

def greet(name):
  print(f"Hello, {name}!")

greet("Markdown User")

Horizontal rules: creating thematic breaks

To create a horizontal line to separate sections, use three or more asterisks (***), hyphens (---), or underscores (___) on a line by themselves.

syntax:

Section 1 content.
---
Section 2 content.
***
Another section.

how it looks:

Section 1 content.

Section 2 content.


Another section.


Practice makes perfect!

That covers the most essential markdown syntax you’ll use day-to-day.

The best way to get comfortable is to start using it.

Open a plain text editor (or use an online markdown editor) and try these out.

Save your work with the .md extension and you have a real Markdown file. Curious what that actually means? Here is what a Markdown file is.

You’ll find it quickly becomes second nature.

For more advanced syntax or specific editor features, there are many great resources online, but these basics will take you a very long way.

Happy writing!