A quick reference to the Markdown syntax.
- Headings
- Paragraphs
- Line Breaks
- Emphasis
- Blockquotes
- Ordered Lists
- Unordered Lists
- Horizontal Rules
- Links
- Images
- Code
- Code Blocks
- Tables
- Escaping Characters
To create a heading, add number signs (#) in front of a word or phrase. The number of number signs you use should correspond to the heading level. For example, to create a heading level three (<h3>), use three number signs (e.g., ### My Header).
Markdown | HTML | Output |
---|---|---|
# Jedi Level 1 | <h1>Jedi Level 1</h1> | |
## Jedi Level 2 | <h2>Jedi Level 2</h2> | |
### Jedi Level 3 | <h3>Jedi Level 3</h3> | |
#### Jedi Level 4 | <h4>Jedi Level 4</h4> | |
##### Jedi Level 5 | <h5>Jedi Level 5</h5> | |
###### Jedi Level 6 | <h6>Jedi Level 6</h6> |
To create paragraphs, use a blank line to separate one or more lines of text. You should not indent paragraphs with spaces or tabs.
Markdown | HTML | Output |
---|---|---|
The Force will be with you. Always. |
<p>The Force will be with you.</p> <p>Always.</p> |
The Force will be with you. Always. |
To create a line break (<br>), end a line with two or more spaces, and then type return.
Markdown | HTML | Output |
---|---|---|
Do. Or do not. · · There is no try. |
<p>Do. Or do not.<br> There is no try.</p> |
Do. Or do not. There is no try. |
You can add emphasis by making text bold or italic.
To bold text, add two asterisks or underscores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.
Markdown | HTML | Output |
---|---|---|
**Bold Text** | <strong>Bold Text</strong> | Bold Text |
Luke **Skywalker** | Luke <strong>Skywalker</strong> | Luke Skywalker |
To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters.
Markdown | HTML | Output |
---|---|---|
*Italicized Text* | <em>Italicized Text</em> | Italicized Text |
Han *Solo* | Han <em>Solo</em> | Han Solo |
To emphasize text with bold and italics at the same time, add three asterisks or underscores before and after a word or phrase.
Markdown | HTML | Output |
---|---|---|
The ***Force***. | The <strong><em>Force</em></strong>. | The Force |
To create a blockquote, add a > in front of a paragraph.
> Why, you stuck-up, half-witted, scruffy-looking nerf herder!
The rendered output looks like this:
Why, you stuck-up, half-witted, scruffy-looking nerf herder!
Blockquotes can contain multiple paragraphs. Add a > on the blank lines between the paragraphs.
> Why, you stuck-up, half-witted, scruffy-looking nerf herder!
>
> As far as Star Wars insults go, this one takes the cake. No contest.
The rendered output looks like this:
Why, you stuck-up, half-witted, scruffy-looking nerf herder!
As far as Star Wars insults go, this one takes the cake. No contest.
Blockquotes can be nested. Add a >> in front of the paragraph you want to nest.
> Why, you stuck-up, half-witted, scruffy-looking nerf herder!
>
>> As far as Star Wars insults go, this one takes the cake. No contest.
The rendered output looks like this:
Why, you stuck-up, half-witted, scruffy-looking nerf herder!
As far as Star Wars insults go, this one takes the cake. No contest.
Blockquotes can contain other Markdown formatted elements. Not all elements can be used — you’ll need to experiment to see which ones work.
> #### Yoda Quotes
>
> - Train yourself to let go of everything you fear to lose.
> - Powerful you have become, the dark side I sense in you.
>
> Yoda Quotes to *Awake* the **Greatness** Within.
The rendered output looks like this:
- Train yourself to let go of everything you fear to lose.
- Powerful you have become, the dark side I sense in you.
Yoda Quotes to Awake the Greatness Within.
To create an ordered list, add line items with numbers followed by periods. The numbers don’t have to be in numerical order, but the list should start with the number one.
You can use other elements like; paragraphs, line breaks, links, images, etc ... within each item.
1. First item
1. Second item
1. Third item
1. Fourth item
The rendered output looks like this:
- First item
- Second item
- Third item
- Fourth item
To create a nested ordered list, simply add 4 spaces in front of the list item.
1. First item
1. Second item
1. Third item
1. Indented item
1. Indented item
1. Fourth item
The rendered output looks like this:
- First item
- Second item
- Third item
- Indented item
- Indented item
- Fourth item
To create an unordered list, add dashes (-), asterisks (*), or plus signs (+) in front of line items. Indent one or more items to create a nested list.
You can use other elements like; paragraphs, line breaks, links, images, etc ... within each item.
- First item
- Second item
- Third item
- Fourth item
The rendered output looks like this:
- First item
- Second item
- Third item
- Fourth item
To create a nested unordered list, simply add 4 spaces in front of the list item.
- First item
- Second item
- Third item
- Indented item
- Indented item
- Fourth item
The rendered output looks like this:
- First item
- Second item
- Third item
- Indented item
- Indented item
- Fourth item
To create a horizontal rule, use three or more dashes (---) on a line by themselves.
---
The rendered output looks like this:
To create a link, enclose the link text in brackets (e.g., [Google]) and then follow it immediately with the URL in parentheses (e.g., (https://google.com)).
[Google](https://google.com/)
You can optionally add a title for a link. This will appear as a tooltip when the user hovers over the link. To add a title, enclose it in parentheses after the URL.
[Google](https://google.com/ "Google Search Engine")
You can format links using Emphasis elements.
*[Google](https://google.com/)*
**[Google](https://google.com/)**
***[Google](https://google.com/)***
To add an image, add an exclamation mark (!), followed by alt text in brackets, and the path or URL to the image asset in parentheses. You can optionally add a title after the URL in the parentheses.
![MD](https://robohash.org/markdown)
The rendered output looks like this:
To add a link to an image, enclose the Markdown for the image in brackets, and then add the link in parentheses.
[![MD](https://robohash.org/markdown)](https://robohash.org/)
The rendered output looks like this:
To denote a word or phrase as code, enclose it in tick marks (`).
Markdown | HTML | Output |
---|---|---|
In the terminal, type `npm install`. | In the terminal, type <code>npm install</code>. | In the terminal, type npm install . |
If the word or phrase you want to denote as code includes one or more tick marks, you can escape it by enclosing the word or phrase in double tick marks (``).
Markdown | HTML | Output |
---|---|---|
``Use `code` in your Markdown file.`` | <code>Use `code` in your Markdown file.</code> | Use `code` in your Markdown file. |
To create code blocks, start a line with three tick marks (```).
```
$ npm install --save-dev
```
The rendered output looks like this:
$ npm install --save-dev
This allows you to add color highlighting for whatever language your code was written in. To add syntax highlighting, specify a language next to the tick marks before the fenced code block.
```html
<link href="/lib/markdown/markdown.css" rel="stylesheet">
<script src="/lib/markdown/markdown.js"></script>
```
Supported Languages
- html
- javascript
- css
- json
The rendered output looks like this:
<link href="/lib/markdown/markdown.css" rel="stylesheet">
<script src="/lib/markdown/markdown.js"></script>
To add a table, use three or more hyphens (---) to create each column’s header, and use pipes (|) to separate each column. You can optionally add pipes on either end of the table.
| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |
The rendered output looks like this:
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
You can align text in the columns to the left, right, or center by adding a colon (:) to the left, right, or on both side of the hyphens within the header row.
| Syntax | Description | Test Text |
| :--- | :----: | ---: |
| Header | Title | Here's this |
| Paragraph | Text | And more |
The rendered output looks like this:
Syntax | Description | Test Text |
---|---|---|
Header | Title | Here's this |
Paragraph | Text | And more |
To display a literal character that would otherwise be used to format text in a Markdown document, add a backslash () in front of the character.
\* Without the backslash, this would be a bullet in an unordered list.
The rendered output looks like this:
* Without the backslash, this would be a bullet in an unordered list.
You can use a backslash to escape the following characters.
Character | Name |
---|---|
\ | Backslash |
` | Tick Mark |
* | Asterisk |
_ | Underscore |
{} | Curly Braces |
[] | Brackets |
() | Parentheses |
# | Pound Sign |
+ | Plus Sign |
- | Minus Sign (Hyphen) |
. | Dot |
! | Exclamation Mark |
| | Pipe |
You don't need to always escape these characters. These characters can be escaped, however these will need to be escaped when they are inside another element that uses these characters.