Text cleanup
Trim Whitespace
Remove invisible padding while keeping meaningful line breaks and indentation under control.
Processed locally. Your input and output are never uploaded.
Tool overview
Trim Whitespace tool overview
Trim Whitespace can clean each line independently, strip only one side, remove outer padding from the whole document, or preserve indentation while still removing trailing spaces.
Where invisible padding causes trouble
- Fix trailing spaces before a code review
- Clean columns copied from spreadsheets
- Normalize values before comparison
- Keep code indentation while removing line-end padding
Trim lines without damaging indentation
- Paste the padded text.
- Select line trimming, whole-text trimming, or one-sided cleanup.
- Enable indentation preservation for code or nested lists.
- Inspect the output and copy it.
Line edges, document edges, and one-sided trim
- Trim each line removes whitespace on both sides of every line.
- Trim entire text touches only the outer boundary of the full paste.
- Preserve indentation prevents leading whitespace from being removed.
- Trailing-only cleanup is safe for indented content.
Clean padded rows
Before
first
second After
first second
Tabs, blanks, and mixed indentation
- Tabs are treated as whitespace.
- Preserved indentation may contain a mix of tabs and spaces.
- Blank lines remain unless another option removes them.
Browse all text cleanup tools →
Questions
Trim Whitespace FAQ
Can I remove trailing spaces without changing indentation?
Yes. Enable trailing-space removal and preserve indentation.
Does trimming remove line breaks?
No. Line structure is preserved unless outer blank space is part of whole-text trimming.