Skip to content

Unindent Text

Remove indentation while keeping the relative nesting intact.

Quick Tool Overview

Unindent Text removes indentation without destroying structure. Dedent mode finds the smallest indentation any line has and removes exactly that much from every line, so a block copied out of the middle of a file moves to the margin with its internal nesting perfectly intact.

What it does
Removes indentation while keeping relative nesting
You give it
A block copied from inside a larger file
You get back
The block at the margin, structure preserved
Best for
Outdenting code and configuration blocks
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Unindent Text

Unindenting is the operation you want after copying a block out of the middle of a file. The block carries the indentation of where it lived, and pasting it somewhere shallower leaves it floating several columns in from where it belongs.

The important part is not removing too much. Dedent mode finds the smallest indentation any line has and removes exactly that from every line, so the nesting inside the block survives perfectly — this is what a code editor's "dedent" does and what you almost always want. Fixed mode removes a set number of columns instead. Tabs and spaces are measured on the same scale using a configurable tab width, so a block indented with a mixture is handled correctly rather than being cut at the wrong point.

Key features of the Unindent Text

Dedent keeps the structure

Only the shared indentation is removed, which is what a code editor's dedent does and what you almost always want.

Configurable tab width

Tabs and spaces are measured on one scale, so a block indented with a mixture is cut at the right column.

Never removes content

Only whitespace is taken, so a line with less indentation than the amount simply loses what it has.

Fixed mode too

Remove an exact number of columns when the shared-indentation rule is not what you need.

Reports the amount removed

How many columns were stripped, so you can confirm the dedent found the level you expected.

How to use the Unindent Text

  1. 1

    Paste the indented block

    Code, configuration or any text carrying indentation from elsewhere.

  2. 2

    Choose the mode

    Dedent removes the common indentation and keeps the nesting; fixed removes a set number of columns.

  3. 3

    Set the tab width

    How many columns a tab counts as, so mixed indentation is measured consistently.

  4. 4

    Copy the result

    The block now sits at the margin with its internal structure intact.

Frequently asked questions

It finds the smallest amount of leading whitespace on any non-blank line and removes exactly that much from every line. The block moves to the margin and every relative indent inside it is preserved.

Reviews of the Unindent Text

What people who use the Unindent Text think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Unindent Text. It takes half a minute and no account.

Write the first review

More text tools