Line Formatting Tools

Dedent Text Online

Strip the shared indentation from every line at once.

PrivateYour text is processed on your device and never uploaded.

Dedent Text Online is a browser-based text tool on TextToolsBase. Strip the shared indentation from every line at once. To use it, paste or type your text and view the result directly in your browser — no signup and nothing to install.

Advertisements
Input
Result
0 chars · 0 lines
Advertisements

Code and quotes pasted from elsewhere often arrive with a shared block of leading indentation you do not want.

Dedent Text finds the smallest common indent across the lines and removes exactly that much from each.

How to use Dedent Text Online

  1. Paste the indented block you want to clean into the input box.
  2. Dedent Text measures the common leading whitespace and strips it from every line.
  3. Copy the dedented text, or download it as a text file.
Advertisements

Use cases

  • Removing the shared indent from a copied code block.
  • Flattening a quoted passage that came in deeply indented.
  • Cleaning leading spaces from text pulled out of a nested list.

Good to know

Dedent Text looks at the non-empty lines, finds the smallest amount of leading whitespace they share, and removes that amount from every line. Relative indentation between lines is preserved, and blank lines are ignored when measuring.

Frequently asked questions

Does Dedent Text remove all indentation?

No. It removes only the indent shared by every line, so deeper nested lines keep their extra spacing.

Do tabs and spaces count the same?

Each leading character is counted by position, so mixing tabs and spaces can affect how much is removed.

Are blank lines considered when measuring?

No. Empty lines are skipped while finding the common indent, so they do not force the removal to zero.

Related Line Formatting Tools