Trim Whitespace
Paste text and trim the leading and trailing whitespace (spaces and tabs) from each line. The content of each line is untouched — only the invisible padding at the start and end is removed.
This is useful for cleaning up indentation inconsistencies, preparing data for comparison (where trailing spaces would cause false mismatches), and tidying up text copied from terminals, emails, or formatted documents that add invisible padding.
Everything runs in your browser — your text is never sent anywhere.
By The Paper Room Editorial Team — Text Tools
Frequently asked questions
Does this remove spaces between words?▼
No — only leading whitespace (before the first visible character) and trailing whitespace (after the last visible character) on each line are removed. Spaces between words within a line are untouched.
Does this handle tabs as well as spaces?▼
Yes — both spaces and tab characters at the start and end of each line are trimmed.
Will this change my line breaks?▼
No — each line is trimmed independently. The number of lines and the line break positions stay the same; only the whitespace padding on each line is removed.