DEV Community

Cover image for A Complete Markdown Tutorial: From Basics to Advanced
MD MAHBUB UDDIN
MD MAHBUB UDDIN

Posted on

A Complete Markdown Tutorial: From Basics to Advanced

Markdown is a lightweight markup language that makes it easy to format text. It’s used widely across many platforms like GitHub, Dev.to, and more for creating well-structured documents, from README files to blogs and even documentation.

In this tutorial, I’ll walk you through the essentials of Markdown—from basic syntax to advanced formatting techniques that will help you create more professional and visually engaging content.

Table of Contents

Basic Markdown Syntax

Intermediate Features

Advanced Markdown


Basic Markdown Syntax

  • Headings (L1-L6)
# Bangladesh

## Bangladesh

### Bangladesh

#### Bangladesh

##### Bangladesh

###### Bangladesh
Enter fullscreen mode Exit fullscreen mode

This will display as:

Bangladesh

Bangladesh

Bangladesh

Bangladesh

Bangladesh
Bangladesh

  • Paragraphs

To create paragraphs, just write text on a new line. You don’t need to add any special syntax—just hit "Enter" twice for spacing between paragraphs.

_italic_ or _italic_  
**bold** or **bold**
Enter fullscreen mode Exit fullscreen mode

This will display as:

Bangladesh

Bangladesh


  • Blockquotes
> Respect for my Country
Enter fullscreen mode Exit fullscreen mode

This will display as:

Respect for my Country


  • Lists

    • Unordered List:
- Item 1
- Item 2
  - Sub-item 1
  - Sub-item 2
Enter fullscreen mode Exit fullscreen mode

This will display as:

  • Item 1
  • Item 2

    • Sub-item 1
    • Sub-item 2
    • Ordered List:
1. First item
2. Second item
Enter fullscreen mode Exit fullscreen mode

This will display as:

  1. First item
  2. Second item

  • Hyperlink
[Google](http://google.com)
Enter fullscreen mode Exit fullscreen mode

This will display as:

Google


  • Images
![Github](https://github.blog/wp-content/uploads/2024/07/github-logo.png)
Enter fullscreen mode Exit fullscreen mode

This will display as:

Github

Hyperlink and Images both syntax are same expect one exclamation mark (!) which is point beginning of the Images tag.


Intermediate Features

  • Code Blocks & Syntax Highlighting

For Single Line Code (between single backticks ‘‘):

`print("Hello Bangladesh!")`
Enter fullscreen mode Exit fullscreen mode

This will display as:

print("Hello Bangladesh!")

For multi-line code blocks( between triple backticks ‘‘‘‘‘‘):

    ```

python
    def hello_bangladesh():
    print("Hello Bangladesh!")


    ```
Enter fullscreen mode Exit fullscreen mode

This will display as:

def hello_bangladesh():
    print("Hello Bangladesh!")
Enter fullscreen mode Exit fullscreen mode

  • Tables
| Header 1 | Header 2 |
| -------- | -------- |
| Row 1    | Data 1   |
| Row 2    | Data 2   |
Enter fullscreen mode Exit fullscreen mode

This will display as:

Header 1 Header 2
Row 1 Data 1
Row 2 Data 2

  • Horizontal Lines
---
Enter fullscreen mode Exit fullscreen mode

This will display as:


Advanced Markdown

  • Escaping Characters
\# Not a heading
Enter fullscreen mode Exit fullscreen mode

This will display as:

# Not a heading


  • Task Lists
- [x] Task 1
- [ ] Task 2
Enter fullscreen mode Exit fullscreen mode

This will display as:

  • [x] Task 1
  • [ ] Task 2

  • Nested Lists
1. Item 1
   - Sub-item 1
   - Sub-item 2
2. Item 2
   - Sub-item 1
   - Sub-item 2
Enter fullscreen mode Exit fullscreen mode

This will display as:

  1. Item 1
    • Sub-item 1
    • Sub-item 2
  2. Item 2
    • Sub-item 1
    • Sub-item 2

  • Markdown in HTML
<h2>Custom HTML Header</h2>
<p>This is a paragraph with <strong>bold</strong> text.</p>
Enter fullscreen mode Exit fullscreen mode

This will display as:

Custom HTML Header

This is a paragraph with bold text.

This allows for greater flexibility, especially if you're embedding media or using specific styles.

Website where you can practices markdown live
MarkdownLivePreview

Don’t wait for the perfect moment to learn Markdown. The power to simplify and enhance your writing is already within your reach. Start today, and watch how this simple tool transforms the way you create, share, and collaborate.

Remember: great content starts with a solid foundation—and that foundation is Markdown.


To everyone who has taken the time to read this post—thank you! I hope this Markdown tutorial has empowered you to take the next step in your journey, whether you're a beginner or someone looking to polish their skills. Remember, learning is a continuous process, and even small steps lead to great achievements.

As you venture into new projects, may you find inspiration and joy in everything you create. Whether you're crafting code, writing blogs, or documenting your ideas, may your path be filled with success, creativity, and growth. Keep pushing boundaries, exploring new horizons, and never stop learning!

Wishing you all the best in your endeavors—let’s keep creating amazing things together!

Top comments (16)

Collapse
 
nikhildev profile image
Nikhil Dev Chunchu

Some of the code block are no displaying properly, ex: Horizontal Lines
`markdown

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Thanks for the heads-up! It’s strange because the code blocks are displaying correctly on other platforms and even on Markdown viewers. I’ll look into why it’s not working here—it might be a platform-specific formatting issue. Appreciate your patience and feedback!

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Already Fixed this issue.

Collapse
 
oculus42 profile image
Samuel Rouse

Thanks for putting this together! Markdown is a great tool with a lot of capabilities, but the different versions create variations and ambiguities in the spec. This in turn creates headaches like the ones with your code examples.

Because of the different versions and implementation inconsistency I recommend adding two resources to your markdown arsenal:

  • CommonMark – A markdown specification with better clarity and compatibility
  • babelmark3 - A tool to see and compare the output of different markdown engines for a given input.
Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Thank you for the valuable feedback! 😊 You’re absolutely right—Markdown’s different versions can cause inconsistencies, which can be frustrating. Thanks again for sharing these great resources!

Collapse
 
morphzg profile image
MorphZG • Edited

Once you master markdown you will use it everywhere. Buty of it is plain text formated so it can display almost everywhere, even if it is displayed as plain text you will like the style. I use it mostly for note taking and readme files.

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Thanks for sharing how you use it—glad to hear from a fellow Markdown fan!

Collapse
 
programmerraja profile image
Boopathi

This is a fantastic overview of Markdown! I especially appreciate the clear examples and the breakdown of advanced features like code blocks and tables. This tutorial is a great resource for anyone wanting to learn Markdown.

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Thank you! 😊 I'm glad you found the tutorial helpful! Let me know if there's anything specific you'd like to see in future Markdown tips.

Collapse
 
gokayburuc profile image
gokayburuc.dev

Add also Github TOC

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Already Added. Thanks Again

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Great suggestion! I'll add a section on creating a TOC for GitHub soon. Thanks for the idea—stay tuned!

Collapse
 
martinbaun profile image
Martin Baun

Wonderfully written and researched!

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Thanks for checking it out! Let me know if there’s anything specific you’d like me to cover next time!

Collapse
 
istiquritconsultant profile image
Istiqur Rahman

I have liked your writing.
I am from Bangladesh too. I am glad to be a part of the community.

Collapse
 
mahbubumithu profile image
MD MAHBUB UDDIN

Thank you so much brother! 😊 Glad to have you in the community—let’s keep learning and growing together!