About this tool
Leading and trailing whitespace sneaks in when copying from spreadsheets, terminals and code editors, and it can break comparisons, imports and diffs. This tool trims every line at once — from the start, the end, or both — while leaving spaces between words alone.
How to use Trim Whitespace
- Paste the text you want to tidy.
- Choose which side of each line to trim.
- Copy or download the trimmed text.
Frequently asked questions
Does it remove spaces between words?
No, only whitespace at the beginning and end of each line is removed. To shrink runs of spaces inside lines, use Remove Extra Spaces.
Which characters count as whitespace?
Regular spaces, tabs, non-breaking spaces and the other Unicode space characters are all trimmed.