Markdown Cheat Sheet

Every markdown syntax element in one place — with examples you can try instantly in the editor.

Headings

Use 1-6 hash characters at the start of a line to create headings. The number of hashes determines the heading level.

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

Renders as H1 through H6 headings, each progressively smaller. H1 is the largest page title; H6 is the smallest sub-heading.

Try in Editor →
Heading 1 ========= Heading 2 ---------

Alternative syntax: underline text with equals signs for H1 or dashes for H2.

Try in Editor →

Paragraphs & Line Breaks

Paragraphs are separated by a blank line. For a hard line break within a paragraph, end the line with two or more spaces or use a backslash.

This is the first paragraph. This is the second paragraph.

Two separate paragraphs with space between them.

Try in Editor →
This line has a line break right here (two trailing spaces). This line has a break\ using a backslash.

A hard line break appears where the trailing spaces or backslash are placed, without starting a new paragraph.

Try in Editor →

Bold, Italic, Strikethrough

Wrap text in asterisks or underscores for emphasis. Use double asterisks for bold, single for italic, and double tildes for strikethrough.

*italic* or _italic_ **bold** or __bold__ ***bold and italic*** or ___bold and italic___ ~~strikethrough~~

italic, bold, bold and italic, and strikethrough text respectively.

Try in Editor →

Blockquotes

Start a line with > to create a blockquote. Nest blockquotes by adding additional > characters.

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

A visually indented block with a left border, like an email quote.

Try in Editor →
> First level of quoting. > > > Nested blockquote. > > Back to the first level.

A nested blockquote renders as a quote-within-a-quote, each level further indented.

Try in Editor →

Ordered & Unordered Lists

Use dashes, asterisks, or plus signs for unordered lists. Use numbers followed by a period for ordered lists. Indent by 2-4 spaces to nest.

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

A bulleted list with a nested sub-list under item two.

Try in Editor →
1. First item 2. Second item 1. Sub-item A 2. Sub-item B 3. Third item

A numbered list with a nested numbered sub-list under the second item.

Try in Editor →
1. First item Additional paragraph under the first item. 2. Second item

List items can contain multiple paragraphs if subsequent paragraphs are indented to align with the text.

Try in Editor →

Code

Use backticks for inline code and triple backticks (or indentation) for code blocks. Add a language identifier after the opening backticks for syntax highlighting.

Inline code: `const x = 42;`

The text between backticks renders in a monospaced font with a subtle background.

Try in Editor →
```javascript function greet(name) { return `Hello, ${name}!`; } ```

A syntax-highlighted code block with the language displayed. Most renderers support hundreds of language identifiers.

Try in Editor →
``` Plain code block without a language. No syntax highlighting. ```

A code block rendered in monospaced font without highlighting.

Try in Editor →
// Indented code block (4 spaces) const y = 100;

Four spaces of indentation also create a code block. This is the original markdown syntax.

Try in Editor →

Images

Images use the same syntax as links, prefixed with an exclamation mark. The text in brackets becomes the alt text.

![Alt text](https://example.com/image.png) ![Alt text](https://example.com/image.png "Optional title")

An embedded image. The alt text is shown if the image fails to load and is read by screen readers.

Try in Editor →
![Logo][logo] [logo]: https://example.com/logo.png "Company Logo"

Reference-style image syntax, useful when reusing the same image URL.

Try in Editor →

Tables

Create tables using pipes and dashes. The second row defines column alignment using colons.

| Name | Role | Status | | ------- | ---------- | ------- | | Alice | Developer | Active | | Bob | Designer | On leave| | Charlie | Manager | Active |

A table with three columns. Columns are left-aligned by default.

Try in Editor →
| Left | Center | Right | | :----- | :-----: | -----: | | 1 | 2 | 3 | | hello | world | ! |

Colons in the separator row control alignment: left colon for left, both colons for center, right colon for right.

Try in Editor →

Horizontal Rules

Create a horizontal rule (thematic break) with three or more dashes, asterisks, or underscores on their own line.

--- *** ___

Each renders as a horizontal line spanning the width of the content area. All three forms are equivalent.

Try in Editor →

Task Lists / Checkboxes

Add checkboxes to list items with [ ] (unchecked) or [x] (checked). This is a GitHub Flavored Markdown extension.

- [x] Write the introduction - [x] Add code examples - [ ] Proofread the document - [ ] Publish

A list with interactive checkboxes. Checked items typically render with a strikethrough or dimmed style.

Try in Editor →

Footnotes

Create footnotes with [^label] in the text and a matching definition elsewhere in the document.

Here is a statement that needs a citation[^1]. And another claim[^note]. [^1]: Source: The Markdown Guide, 2024. [^note]: This is a longer footnote with multiple lines of content.

Superscript numbers appear inline and link to the footnote definitions collected at the bottom of the rendered page.

Try in Editor →

Definition Lists

Some markdown processors support definition lists. Place the term on one line, then the definition on the next line prefixed with a colon and a space.

Markdown : A lightweight markup language for creating formatted text using a plain-text editor. HTML : The standard markup language for documents designed to be displayed in a web browser.

Each term is rendered in bold or a distinct style, with its definition indented below it. Not supported by all renderers.

Try in Editor →

Escaping Characters

Prefix any markdown special character with a backslash to display it literally.

\*This is not italic\* \# This is not a heading \[This is not a link\](url) \| Not | a | table |

The special characters are rendered as plain text instead of being interpreted as markdown formatting.

Try in Editor →
Escapable characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash + plus sign - dash . period ! exclamation mark | pipe

All markdown special characters can be escaped with a backslash.

Try in Editor →

Ready to write some markdown?

Open the Editor