Basics of Markdown - Syntax and Examples

November 28, 20214 min read

Markdown

Markdown is a lightweight markup language that is used to format text on the web. It was created in 2004 by John Gruber, a software developer, and Aaron Swartz, an internet activist, as a way to write and format text in a simple and straightforward manner.

Markdown is written in plain text, which means you can use any text editor to write in it. It uses a set of special characters and symbols to indicate formatting, such as bold, italic, and headers. This makes it easy to read and write, as you don’t have to use complex formatting tools or HTML tags.

Here is a table of the most common Markdown syntax:
Syntax Description
# Denotes a heading. The number of # symbols indicates the heading level (e.g. # is a top-level heading, ## is a second-level heading, etc.)
* , - Denotes a bullet point in a list.
1. Denotes a numbered list.
[text](url) Denotes a link. The text is the text that will be displayed, and the url is the link destination.
**text** Denotes bold text.
_text_ , *text* Denotes italic text.
> Denotes a blockquote.
``` code ``` Denotes a code block. Anything between the backticks will be formatted as code.
![alt text](image url) Denotes an image. The alt text is a description of the image, and the image url is the location of the image.
___ Denotes an horizontal Line
Here are some examples of how these syntax elements can be used in Markdown:
# Heading Level 1
## Heading Level 2
### Heading Level 3
#### Heading Level 4
##### Heading Level 5
###### Heading Level 6

* Bullet point 1
* Bullet point 2
* Bullet point 3

1. Numbered list item 1
2. Numbered list item 2
3. Numbered list item 3

---
horizontal line


- Unordered List item 1
- Unordered List item 2
- Unordered List item 3

[Link example](http://example.com)
![alt text](https://images.unsplash.com/photo-1541364983171-a8ba01e95cfc?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80)

**Bold text**

*Italic text*

> Blockquote

`Single line of code`

```
Multiline of code
Next line
Last line
```

Preview of above markdown

Heading Level 1

Heading Level 2

Heading Level 3

Heading Level 4

Heading Level 5
Heading Level 6
  • Bullet point 1
  • Bullet point 2
  • Bullet point 3
  1. Numbered list item 1
  2. Numbered list item 2
  3. Numbered list item 3

horizontal line

  • Unordered List item 1
  • Unordered List item 2
  • Unordered List item 3

Link example
alt text

Bold text

Italic text

Blockquote

Single line of code

Multiline of code
Next line
Last line

As you can see, Markdown is a simple and easy-to-use language that allows you to format text for the web without the need for complex tools or HTML tags. It is widely used in blogging platforms, online forums, and even in version control systems like Git.

Checkout my markdown previewer project


Vishal Sharma

Hey there! This is Vishal Sharma. I reside and work at Gurgaon, India. I am a Software Engineer and primarily works with JavaScript, ReactJS and NodeJS.
LinkedIn Link

Welcome to my Javascript tech blog! Here, you'll find the latest news and updates in the world of Javascript, as well as tutorials and resources to help you improve your coding skills. From learning the basics of Javascript to advanced concepts like object-oriented programming, I post something for developers of all levels. Whether you're just starting out or you're a seasoned pro, you'll find valuable insights and information on our blog. So stay up-to-date with the latest in Javascript technology by bookmarking this page and checking back often.
Thank you for visiting!