Skip to content
TabKiwiTabKiwi

Trim Whitespace

Remove spaces and tabs from the start, the end, or both ends of every line.

TextRuns in your browser. Your files never leave this device.
Loading tool…

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

  1. Paste the text you want to tidy.
  2. Choose which side of each line to trim.
  3. 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.

More Text tools

View all 60 →