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
- Paste the indented block you want to clean into the input box.
- Dedent Text measures the common leading whitespace and strips it from every line.
- Copy the dedented text, or download it as a text file.
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.