Text
Text Dedenter
Input
Output
Run process to generate output.
Frequently Asked Questions
What is dedenting?
Dedenting removes leading whitespace from the beginning of each line — either a fixed amount (e.g. remove 4 spaces) or the minimum shared indent level (normalize). This is opposite of indenting and is useful for unindenting copy-pasted code blocks.
What is 'common indent removal' mode?
This mode finds the minimum number of leading spaces shared across all non-blank lines and removes exactly that amount from every line. The relative indentation between lines is preserved. Python's textwrap.dedent function works this way.
What happens to lines with less indentation than the removal amount?
In fixed-amount mode, those lines are dedented to zero (no negative indentation is possible). In common-indent mode, all lines retain their relative indentation since only the shared minimum is removed.