Markdown Indentation: Indent Text, Lists, and Code

September 11, 2026 · 10 min read

Markdown Indentation: How to Indent Text, Lists, and Code

Markdown indentation follows one rule: four spaces (or one tab) at the start of a line creates a code block, while one to three spaces are ignored. To indent a paragraph you need  , a blockquote, or HTML. This guide shows the exact recipe for each case and where tabs behave differently.

The One Rule Behind Markdown Indentation

Every indentation surprise in Markdown traces back to one line in the CommonMark spec (0.31.2). An indented code block is any chunk of lines with four or more spaces of indentation. The spec's paragraph section adds the other half. Up to three leading spaces are allowed and stripped; four is too many.

So the parser has no concept of "indent this text a bit", and indentation in Markdown is binary. Leading whitespace is either nothing (1 to 3 spaces) or code (4 or more). Here is the same sentence four times:

 One leading space.
   Three leading spaces.
    Four leading spaces.
	One tab.

The first two lines render as ordinary paragraph text with the spaces removed. Lines three and four render as a monospace code block. That is the moment most people hit when they "just wanted to indent a bit".

There's one exception to know. An indented code block cannot interrupt a paragraph. If the four-space line sits directly under a normal line with no blank line between them, it joins the paragraph and the spaces vanish. Add a blank line above it and it becomes code again.

Markdown tab vs space: what a tab in Markdown does

A markdown tab is not converted to spaces. The spec's Tabs section says tabs only behave as spaces "in contexts where spaces help to define block structure". There they count as a tab stop of 4. In practice:

  • A tab at the start of a line equals four spaces, so it starts an indented code block.
  • A tab after a list marker (- then tab) works like the spaces after a marker and defines the content column.
  • A tab in the middle of a line (a b) is passed through as a literal tab character. The browser then collapses it to a single space in normal text.

This is why markdown tabs rarely do what people expect. A tab in Markdown gives you code blocks and list nesting, not a paragraph indent. If your editor inserts a tab when you press the Tab key, you're one keystroke away from an accidental code block on every line.

We prefer spaces for anything you intend to share. A file that mixes tabs and spaces looks aligned in one editor and broken in the next. The tab stop of 4 only applies where the parser is measuring indentation.

How to Indent in Markdown Format?

Match your goal to the recipe. Every row except the HTML one works in GitHub, Obsidian, and the site editor.

You want toUseWhy
Indent a whole paragraph> blockquoteOnly native block-level indent
Indent the first line by a few characters  entitiesEntities are never stripped
Indent a precise amount (0.5 inch, 2em)Inline HTML with a styleRendered where HTML is allowed
Continue a paragraph under a list itemIndent to the content columnSpec's list-item rule
Show indented codeFenced block, not spacesSurvives copy-paste and nesting
Nest one list inside anotherIndent to the parent's content columnSee the lists guide

The last row is covered in depth in the Markdown lists guide, so this post stays on paragraphs, continuation lines, tabs, and code. For the fenced block itself, the Markdown code block guide explains fences and language hints.

How Do You Do a 0.5 Indent in Markdown?

You can't in pure Markdown. There is no syntax for a half-inch first-line indent, and any leading spaces you type are discarded. Three workarounds cover most needs, from least to most control.

Non-breaking space entities. CommonMark recognises HTML entity references everywhere except inside code, so   survives where a real space wouldn't. Four of them give a visible indent of roughly one em.   is a single em-width space if you want fewer characters in the source.

    This paragraph starts with a visible indent.

 So does this one, with a single em space.

A blockquote. The > marker indents the whole block and adds a left border in most themes. It's semantically a quote, so use it for quoted text or asides. The Markdown blockquote guide covers nesting and multi-paragraph quotes.

Inline HTML. Where the platform allows it, a styled paragraph gives you exact control. GitHub strips inline styles, so this route works in static site generators and exported HTML, but not in a README.

<p style="text-indent: 0.5in">A true half-inch first-line indent.</p>

One acknowledged limitation: none of these carry into plain-text views. Someone reading the raw .md file sees &nbsp; four times. If the source matters as much as the output, a blockquote is the only option that reads well both ways.

Markdown List Indent: Continuation Lines and Indent Without a Bullet

Searches for markdown indent bullet or markdown indent list without a new bullet almost always mean this case. You have a list item and want a second line or paragraph under it, aligned with the text, with no new bullet.

The list items section of the spec gives the rule: content belongs to the item when it's indented to the column after the marker and its spaces. For - that's column 2, for 1. it's column 3, for 10. it's column 4.

- First item
  This line continues the first item without a bullet.

  This is a second paragraph inside the same item.

1. Numbered item
   Three spaces here, because the marker is three characters wide.

Both render as one list item with two paragraphs. Drop the indent to one space and the second paragraph escapes the list and becomes a normal paragraph after it. Go to four or more spaces past the content column and you'll get an indented code block inside the item.

A line directly under the item with no blank line is a lazy continuation, and it joins the item even with zero indent. Line endings inside that item follow the same rules as everywhere else; the Markdown line break guide explains the trailing-space and backslash forms.

Try Markdown Indentation in the Editor

Copy the block below into the editor and watch where the text flips into a code block. Then change the four-space line to three spaces and see it flip back. (The editor loads its own sample without leading spaces, which is why the indented lines live in this block for you to paste.)

 One leading space stays a paragraph.
   Three leading spaces also stay a paragraph.

    Four leading spaces become a code block.

- List item
  Continuation without a bullet.

  Second paragraph inside the item.

The sample already in the editor covers the recipes that need no leading spaces: entities, a blockquote, a lazy continuation line, and a fence.

Indentation in Markdown

    Four entities give a visible first-line indent.

A blockquote indents the whole block.

  • List item
    A lazy continuation line joins the item with no indent at all.
A fenced block shows code without any leading spaces.

Paste the indented sample from above here to watch the four-space rule.

55 words349 characters14 lines
Markdown

The Markdown to HTML tool shows the generated HTML, which is the fastest way to confirm whether a line became a <p> or a <pre>.

Indent in Markdown on GitHub, Obsidian, and VS Code

The spec rules above hold on every CommonMark renderer. The differences are in how each editor handles the Tab key and HTML.

GitHub follows the four-space rule in README files, issues, and comments. Its formatting docs tell you to line nested items up under the first character of the parent's text. In the web editor, highlight lines and press Tab or Shift+Tab to indent or dedent them. GitHub keeps &nbsp; entities but removes style attributes, so use entities or a blockquote for paragraph indents in a README.

Obsidian binds Tab and Shift+Tab to indent and unindent selected list items, per its syntax help page. The same page notes that indenting text with Tab or four spaces creates a code block, so a Tab press outside a list makes code, not an indent. Obsidian renders inline HTML, including a styled paragraph.

VS Code targets CommonMark through the markdown-it library, per its Markdown docs, so the preview matches the examples in this post. Whether Tab inserts a tab character or spaces depends on your editor.insertSpaces setting; set it to spaces for Markdown to avoid surprise code blocks.

Common Markdown Indentation Mistakes

Indenting a paragraph with four spaces. It becomes a code block. Use &nbsp;, a blockquote, or drop the indent. If you meant to show code, use a fence instead so the block survives inside lists.

Indenting a list continuation by two spaces under a numbered item. 1. is three characters wide, so two spaces isn't enough and the paragraph escapes the list. Count the marker plus one space and indent to that column.

Mixing a tab and spaces in one list. A tab counts as a jump to the next multiple of 4, not as a fixed four spaces. An item indented with two spaces followed by a tab lands on column 4, not 6, and the nesting shifts. Convert tabs to spaces before sharing.

Markdown Indentation FAQ

Markdown indentation is simpler than the forum threads suggest once you know the rule: three spaces do nothing, four make code, and a tab equals four. Indent paragraphs with entities or a blockquote, continue list items at the content column, and use fences for code. Paste the indented sample into the editor to see each case render live.