← Back to Tools

Text Dedent

Remove common leading whitespace from all lines

How it works

This tool removes the common leading whitespace (indentation) from all lines in your text.

Algorithm:

  1. Finds the minimum indentation across all non-empty lines
  2. Removes that amount of leading whitespace from every line
  3. Preserves the relative indentation between lines
  4. Empty lines remain unchanged

Example:

Input (8 spaces before first item):
 - Item 1
 - Item 2
Output (8 spaces removed):
- Item 1
 - Item 2