Add Indentation in Markdown

Here's how you can add indentation in Markdown documents.

Indentation refers to adding space before a text or a line. These days, it is particularly helpful in writing easy-to-follow programs.

In some rare cases, you may want to write text with indentation. It can help you organize or structure your Markdown document providing clarity.

There is no Markdown-specific syntax to it. But you can use HTML notations to add indentation in Markdown.

Here are various ways to add indentation in Markdown:

  • Using four spaces
  • Using Tab
  • Using > (greater than)
  • Using   or  

You can add hard spaces, press tab key, or refer to various other methods to add indentation in a Markdown document.

For instance, if you have a list in your Markdown document with sub-points, you can add an indentation to denote the child lists and keep them separate from the parent list.

Adding Indentation With   or  

While this may not be the cleanest/most efficient way to add indentations to your document, it sure works. You must add the   before your text or sentence to add a visible space:

  This is the example line.

  stands for non-breaking space that adds spaces between both sides. This is a character that renders space for HTML view.

So, adding to the start of a word or sentence will not have an impact. You might want to use the quickest way to add a new line in Markdown along with this for a faster experience.

Indentation example in Markdown
Indentation with   (Click to enlarge)

Similarly, you can replace it with   to add e-n size spaces, visually acting as two regular spaces.

You are using another markup language to add a space here. It should work, but the Markdown document that makes it possible may look a bit ugly as per your requirements.

Want to learn Markdown? Refer to our Markdown beginner's guide to explore.

Adding Indentation Using 4 Spaces With Lists

List indentation in Markdown
Indentation with lists (Click to enlarge)

4 spaces add one level of indentation. You can test this out when you want to create sub-level of lists.

Here's what the Markdown code looks like:

- List
- List 2
    - Sub-level list 1 with four spaces
    - Sub-level list 2 with four spaces

Of course, you must know how to create nested lists in Markdown before incorporating indentation.

Adding Indentation Using Tab With Lists

Instead of 4 keystrokes, you need to press the Tab key once, and that's it.

The Tab key should be handy when adding more spaces, like adding a third sub-level in a list.

Here's what it looks like:

List indentation in Markdown
Indentation with lists using Tab and spaces (Click to enlarge)

The Markdown code for it looks like this:

- List
- List 2
    - Sub-level list 1 with four spaces
		- Sub-level list 2 with two tabs

Suggested Read ๐Ÿ“–

How to Add Bold and Italic Text in Markdown
Learn how to emphasize text in Markdown by adding bold and italics texts.

Using Indentation With Blocks

Indentation with a blockquote under a list (Click to enlarge)

Note that > does not add an indentation but a blockquote.

The line must be indented if you need to add a blockquote within a list item.

Just like this:

* List item example

    >blockquote with indentation using 4 spaces

Indentation Keeps it tidy

It might sound like a small thing in a Markdown document. But indentation helps structure your sentences and lists to provide a clean layout.

Suggested Read ๐Ÿ“–

11 Best Markdown Editors for Linux
Markdown is a simpleย markup language. Itโ€™s lightweight and easy to learn. If you havenโ€™t seen any markdown document yet, just head over to GitHubย and enter any open-source project. The README file almost certainly will be written using Markdown. Basically, you use some โ€˜codeโ€™ before your text

I hope this quick tip with indentation helps you create better Markdown documents. Share your thoughts in the comments below.

About the author
Ankush Das

Ankush Das

A passionate technophile who also happens to be a Computer Science graduate. You will usually see cats dancing to the beautiful tunes sung by him.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world


Great! Youโ€™ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.