Tool
Trim Lines
Trim leading and trailing whitespace from each line of text.
Text Tools
What this tool does
Remove leading and trailing whitespace from every line while preserving line breaks.
How to use
- Paste text with extra spacing into the input area.
- Review trimmed output line by line.
- Copy the cleaned text for reuse.
Examples
Spaced list items
Input: apple banana orange
Output: apple banana orange
Spaces before and after each line are removed.
Common use cases
- Normalize pasted code or config snippets
- Clean CSV or TSV exports before processing
- Fix inconsistent indentation in lists
FAQ
Does this remove empty lines?
No. Use Remove Empty Lines to drop blank rows entirely.
Are tabs trimmed too?
Yes. Leading and trailing tabs and spaces are removed.
Will internal spacing change?
Spaces between words on the same line are preserved.
Does this affect blank lines?
Blank lines are preserved; only leading and trailing whitespace on each line is removed.
Related tools
Last reviewed: 2026-05-23