Markdown Cheat Sheet - Easy Markdown Syntax reference

Writing in Markdown is super easy and for times when you are looking for the syntax, here is your markdown cheat sheet.


Author: Abhay Talreja Published on: 20, 2020

This markdown cheat sheet is intended to be a quick reference and showcase some of the features of Markdown.

For more complete info, see John Gruber’s original spec and the Github-flavored Markdown info page.

If you want to read the detailed article about markdown, you can check it out here.

If you are interested in watching a video rather than reading, please check out my video on youtube.

§ Headings in Markdown

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

§ Heading 1

§ Heading 2

§ Heading 3

§ Heading 4

§ Heading 5
§ Heading 6

§ Alternate approach to writing Headings in Markdown

This is Heading 1
=================

This is Heading 2
-----------------

§ This is Heading 1

§ This is Heading 2


§ Paragraphs in Markdown

This is paragraph 1

This is paragraph 2

This is paragraph 1

This is paragraph 2


§ Line Breaks in Markdown

This is line 1
This is line 2

This is line 1 This is line 2

§ Horizontal Rule in Mardown

---
3 dashes
___
3 underscores
***
3 astericks



§ Escape characters in markdown

\*

will result in *

Here is a list of all the special characters that you can escape.

Character Name
\ backslash
` backtick
* asterisk
_ underscore
{ } curly braces
[ ] brackets
( ) parentheses
# pound sign
+ plus sign
- minus sign (hyphen, dash)
. dot
! exclamation mark
| pipe (see also escaping pipe in tables)
"

§ Emphasis - Bold Text in Markdown

To make a text bold, all you need to do is wrap it in betwee double * signs. Something like below.

This text is **Bold**

This text is Bold

This text is __Bold too__

This text is Bold too

§ Emphasis - Italics Text in Markdown

To make a text bold, all you need to do is wrap it in betwee single * signs. Something like below.

This text is *Italic*

This text is Italic

You can also wrap the text in between 2 underscores to make a text bold.

This text is _Italic too_

This text is Italic too

§ Emphasis - Bold & Italics Text in Markdown

You can also use the bold and italics together.

This text is ***Bold and Italic***

This text is ___Bold and Italic___

This text is **_Bold and Italic_**

This text is _**Bold and Italic**_

This text is __*Bold and Italic*__

This text is *__Bold and Italic__*

This text is Bold and Italic

This text is Bold and Italic

This text is Bold and Italic

This text is Bold and Italic

This text is Bold and Italic

This text is Bold and Italic

§ Strike Through in Markdown

This is a ~~Striked Text~~

This is a Striked Text

This is a ~~**bold and striked text**~~

This is a bold and striked text

[Abhay Talreja](https://www.abhaytalreja.me)

The result will look like this - Abhay Talreja

[Abhay Talreja](https://www.abhaytalreja.me "Abhay Talreja website link")

Abhay Talreja

[Abhay Talreja with reference][website]

[website]: https://abhaytalreja.me

Abhay Talreja with reference

[Abhay Talreja with reference][website]

[website]: https://www.abhaytalreja.me "Abhay Talreja's website"

Abhay Talreja with reference and title

§ Auto linking in Markdown

https://www.abhaytalreja.me

https://www.abhaytalreja.me

`http://www.example.com`

http://www.example.com

<https://www.abhaytalreja.me>

https://www.abhaytalreja.me

<hi@abhaytalreja.me>
hi@abhaytalreja.me

hi@abhaytalreja.me hi@abhaytalreja.me

§ Images in Markdown

![Markdown Image](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/208px-Markdown-mark.svg.png)

The rendered Image will look like below:

§ Linking Images in Markdown

![Markdown Image](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/208px-Markdown-mark.svg.png)

[![Markdown Image](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/208px-Markdown-mark.svg.png)][my-website]

[my-website]: https://abhaytalreja.me "Click to see Abhay Talrejas website"

§ Blockquotes in Markdown

> This is a blockquote

This is a blockquote

> This is a blockquote
>
> More of the blockquote

This is a blockquote

More of the blockquote

You can also have nested blockquotes

> This is a blockquote
    > This is a nested blockquote

This is how the output will look like

This is a blockquote This is a nested blockquote

> #### This is an important blockquote
>
> - This is item 1 in blockquote
> - This is item 2 in blockquote
>
> This was said by someone really **important**

The output looks like below:

§ This is an important blockquote

  • This is item 1 in blockquote
  • This is item 2 in blockquote

This was said by someone really important

§ Lists in Markdown

There are 2 types of lists, ordered and unordered list. We will see both of these lists in detail.

§ Ordered List in Markdown

1. Item 1
2. Item 2
3. Item 3
4. Item 4

Output:

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
1. Item 1
1. Item 2
1. Item 3
1. Item 4

1. Item 1
7. Item 2
2. Item 3
5. Item 4

Output is still the same:

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
§ Nested Ordered List in Markdown
1. Item 1
2. Item 2
3. Item 3
    1. Nested Item 1
    2. Nested Item 2
4. Item 4

Output:

  1. Item 1

  2. Item 2

  3. Item 3

    1. Nested Item 1
    2. Nested Item 2
  4. Item 4

§ Unordered lists in markdown

- Item 1
- Item 2
- Item 3
- Item 4

* Item 1
* Item 2
* Item 3
* Item 4

+ Item 1
+ Item 2
+ Item 3
+ Item 4

* Item 1
- Item 2
+ Item 3
* Item 4
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 1
  • Item 2
  • Item 3
  • Item 4
§ Nested Unordered List in Markdown
- Item 1
- Item 2
    - Nested Item 1
    - Nested Item 2
- Item 3
- Item 4
  • Item 1

  • Item 2

    • Nested Item 1
    • Nested Item 2
  • Item 3

  • Item 4

§ Adding blockquotes in a list

- First Line
- Second Line
    > A blockquote
- Third Line

You just need to make sure to indent the block quote by 4 spaces or a tab.

  • First Line

  • Second Line

    A blockquote

  • Third Line

§ Code blocks using Markdown

§ Inline Code blocks using Markdown

Here is an example of inline code block - `var x = 10;`

Here is an example of inline code block - var x = 10;

If you want to enclose a piece of code which already has backtick in it, you will want to escape the backtick. In that scenario, you can enclose it in double backtick.

You can use var x = `'hello' + ${firstName}` in your file

§ Code blocks using Markdown

```
    <html>
        <head></head>
        <body></body>
    </html>
```
<html>
    <head></head>
    <body></body>
</html>

Now, watch this html code turn into html style formatting using the word html after the first set of backticks.

```html
    <html>
        <head></head>
        <body></body>
    </html>
```
<html>
  <head></head>
  <body></body>
</html>

Similarly, if you have a json file, you can style it as a json object, so it is easy for your readers to consume it.

```json
    {
        firstName: "John",
        lastName: "Doe",
        age: 30
    }
```
{
  "firstName": "John",
  "lastName": "Doe",
  "age": 30
}

Markdown Cheat Sheet

With that being said, that brings us to the end of this article. If you enjoyed the video or reading this article, please make sure to add your comments below and share it with your friends. Do subscribe to my youtube channel and hit the bell icon.

If you have any other topics that I should be covering next, please let me know in the comments of the youtube video.

Subscribe to the email updates for new blog articles.

Happy Learning! Keep Sharing!