Markdown cheat sheet
Summary
This cheat sheet provides a comprehensive overview of Markdown syntax, covering text formatting, headings, lists, links, images, code blocks, tables, and more. It also highlights advanced features like footnotes, syntax highlighting, and custom HTML integration.
Introduction #
Markdown is a lightweight markup language used to format text on the web. It provides an easy-to-read and easy-to-write syntax for creating well-structured content. The cheat sheet covers essential Markdown features, including text formatting, headings, lists, links, images, and more, helping you create clean and professional-looking documents with minimal effort.
Text formatting #
- Bold:
**bold**or__bold__render as bold - Italic:
*italic*or_italic_render as italic - Bold & Italic:
***bold & italic***renders as bold & italic - Strikethrough:
~~strikethrough~~renders asstrikethrough
Headings #
- Heading 1
# Heading 1will be renderd as<h1>Heading 1</h1> - Heading 2
## Heading 2will be rendered as<h2>Heading 2</h2> - Heading 3
### Heading 3will be rendered as<h3>Heading 3</h3> - Heading 4
#### Heading 4will be rendered as<h4>Heading 4</h4> - Heading 5
##### Heading 5will be rendered as<h5>Heading 5</h5> - Heading 6
###### Heading 6will be rendered as<h6>Heading 6</h6>
Lists #
Unordered list #
- Item 1
- Item 2
- Sub-item 1
- Sub-item 2
Will be renderd as:
- Item 1
- Item 2
- Sub-item 1
- Sub-item 2
Alternatively:
* Item 1
* Item 2
* Sub-item 1
* Sub-item 2
Will be renderd as:
- Item 1
- Item 2
- Sub-item 1
- Sub-item 2
Ordered list #
1. First
2. Second
1. Sub-item 1
2. Sub-item 2
Will be rendered as:
- First
- Second
- Sub-item 1
- Sub-item 2
Also:
1. First
1. Second
1. Sub-item 1
1. Sub-item 2
Will be rendered as:
- First
- Second
- Sub-item 1
- Sub-item 2
Tasks lists #
- [x] Task 1
- [x] Subtask 1.1
- [ ] Subtask 1.2
- [ ] Task 2
Will be rendered as:
- Task 1
- Subtask 1.1
- Subtask 1.2
- Task 2
Links #
Automatic links #
<https://example.com>
<email@example.com>
Will be rendered as:
https://example.com
email@example.com
Named links #
[Link to example.com](https://example.com/)
Will be renderd as:
Named links with title #
[Link to example.com](https://example.com/ "Title")
Will be renderd as:
Line breaks #
Two spaces method #
Add two spaces (denoted as ␣␣) at the end of a line, then press Enter. The ↵ characters denote a line break. This inserts a line break (<br>).
First line.␣␣↵
Second line.
Will be rendered as:
First line.
Second line.
Blank line method #
Insert a blank line between two lines of text (new paragraph).
First line.↵
↵
Second line.
Will be rendered as:
First line.
Second line.
Images #
With alt-attribute #

Will be rendered as:
With alt and title-attributes #
 · Department of Information Technology Instructions & Guides (DITIG).")
Will be rendered as:
See the full article on how to add images in markdown for more detailed information, like how to add image dimensions, classes, etc.
Linked image #
[ · Department of Information Technology Instructions & Guides (DITIG).")](https://www.ditig.com/)
Will be rendered as:
Blockquotes #
Put blank lines before and after blockquotes.
Single paragraph #
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
Will be rendered as:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
Multiple paragraphs #
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
>
> Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.
Will be rendered as:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.
Nested blockquote #
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
>> Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. Curabitur tristique euismod tempus.
>
> Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.
Will be rendered as:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. Curabitur tristique euismod tempus.
Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.
Structured blockquotes #
> #### Lorem Ipsum Dolor
> Lorem ipsum dolor sit amet, _consectetur_ adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
>> Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. **Curabitur** tristique euismod tempus.
>
> Vivamus laoreet tortor quis lacus porta, a pretium **lorem convallis**.
Will be rendered as:
Lorem Ipsum Dolor #
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. Curabitur tristique euismod tempus.
Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.
Code #
Inline code #
Use `code()` for inline code.
Will be rendered as:
Use code() for inline code.
Code block #
```
print("Hello, World!")
```
Will be rendered as:
print("Hello, World!")
Also see: Code blocks in markdown lists
Tables #
| Header 1 | Header 2 |
|--- |--- |
| Row 1 | Data 1 |
| Row 2 | Data 2 |
Will be rendered as:
| Header 1 | Header 2 |
|---|---|
| Row 1 | Data 1 |
| Row 2 | Data 2 |
Horizontal rule #
---
Will be rendered as:
Also:
***
Will be rendered as:
Escaping #
Use \ to escape special characters.
\*escaped asterisk\*
Will be rendered as:
*escaped asterisk*
Escapable characters #
| Char | Character name |
|---|---|
< > | angle brackets |
* | asterisk |
\ | backslash |
` | backtick |
[ ] | brackets |
{ } | curly braces |
. | dot |
! | exclamation mark |
- | minus sign (hyphen) |
( ) | parentheses |
| | pipe |
+ | plus sign |
# | pound sign |
_ | underscore |
HTML #
<b>Bold with HTML</b>
<i>Italic with HTML</i>
<span style="color: red;">Red Text</span>
Will be rendered as:
Bold with HTML
Italic with HTML
Red Text
Limited support #
The following features are only supported in some (not all) Markdown processors, e.g. GitHub-flavored Markdown. These features extend Markdown’s basic syntax.
Footnotes #
This is a sentence with a footnote.[^1]
[^1]: This is the footnote text.
Definition lists #
Term 1
: Definition for term 1
Term 2
: Definition for term 2
Syntax highlighting #
```javascript
function greet() {
console.log("Hello, World!");
}
Will be rendered as:
function greet() {
console.log("Hello, World!");
}
Emojis #
:smile: :rocket: :sparkles:
Will be rendered as:
😄 🚀 ✨
Custom IDs for headings #
### Heading with ID {#custom-id}
Will be rendered as:
<h3 id="custom-id">Heading with ID</h3>
Further readings #
Sources and recommended, further resources on the topic:
- Markdown Specification
- GitHub Flavored Markdown (GFM) Spec
- GitLab Flavored Markdown (GLFM)
- Wikipedia: Markdown
License
Markdown cheat sheet by Jonas Jared Jacek is licensed under CC BY-SA 4.0.
This license requires that reusers give credit to the creator. It allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only. To give credit, provide a link back to the original source, the author, and the license e.g. like this:
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://www.ditig.com/markdown-cheat-sheet">Markdown cheat sheet</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://www.j15k.com/">Jonas Jared Jacek</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0</a>.</p>For more information see the Ditig legal page.