DEV Community

Cover image for Basics of Markdown - Syntax and Examples
Vishal Sharma
Vishal Sharma

Posted on • Originally published at codeentity.tech on

Basics of Markdown - Syntax and Examples

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 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 | 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`

Enter fullscreen mode Exit fullscreen mode

Multiline of code
Next line
Last line

Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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

Top comments (0)