EN
My tools

Indent / Unindent Text

Indent every line by spaces, tabs or a prefix like > , outdent by N spaces, remove common indentation (dedent), or convert tabs to spaces and back with tab stops.

Added once to each line, e.g. > for a quote or // for a comment.
Result
4 lines changed of 5

Tab stops are every 4 columns: a tab moves to the next multiple of 4, as in code editors.

My tools →
Advertisement

Shift a block of text or code left or right in one go. Indent every line by a number of spaces or tabs, or add a prefix such as “> ” for an email quote or “// ” for comments; outdent by a set amount; or strip the indentation that all lines share, which is what you need after copying a nested snippet out of a larger file. Two more modes convert tabs to spaces using proper tab stops, or turn leading spaces into tabs.

How to use this tool

  1. Paste the text or code.
  2. Choose indent, outdent, remove common indentation, tabs → spaces or spaces → tabs.
  3. Set the amount, what to indent with, and the tab width your editor uses.
  4. Copy the result.

Formula

Tab stop: a tab at column c moves to the next multiple of the tab width, c + (w − c mod w)

Removing common indentation works like Python’s textwrap.dedent: it finds the longest run of spaces and tabs that every non-blank line starts with and removes it, leaving relative indentation intact. Outdent removes up to N columns of leading whitespace from each line and never splits a tab. Spaces → tabs only changes the indentation at the start of lines, so spaces inside the text are kept. Blank lines are left alone when indenting unless you untick that option.

Example

The sample Python snippet is indented by 4 spaces throughout. “Remove the indentation all lines share” gives def greet(name): at the left margin with its body at 4 and 8 spaces, as it would be at the top of a file; 4 of 5 lines change (the blank line stays as it is).

Frequently asked questions

How do I remove extra indentation from copied code?

Choose “Remove the indentation all lines share”. It removes only what every line has in common, so the code’s own nesting is preserved.

Should I use tabs or spaces?

Follow the project’s style guide or the language’s convention: Python recommends 4 spaces, Go uses tabs, and most JavaScript style guides use 2 spaces. This tool converts between them either way.

Why did tabs → spaces insert fewer spaces than the tab width?

A tab moves to the next tab stop, not a fixed number of spaces. After “a” (column 1) a tab with width 4 adds 3 spaces to reach column 4.

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). Indent / Unindent Text. https://kakao.mobile/tools/text-indenter/

MLA

“Indent / Unindent Text.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/text-indenter/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement