Trim spaces from each line
Good for lists copied from spreadsheets or code that carry hidden spaces at the ends of lines.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter text and side.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
The text is split into lines and any run of whitespace (space, tab, no-break space and similar) is removed from the start, the end, or both.
Example
Inputs: Side = Start and end. Result: Result: Apples Oranges Bananas; Lines changed: 3.
Apples Oranges Bananas
Apples Oranges Bananas
Limits and caveats
- Runs of spaces inside a line are not reduced; use the whitespace cleaner for that.
- Trimming the start removes code indentation.
Questions about this tool
Why do two values that look the same not match in my sheet?
Often one carries an invisible trailing space. Trimming each line fixes it.
Does it remove no-break spaces?
Yes. They count as whitespace and are trimmed like ordinary spaces.
Does it remove blank lines?
No. The line count stays the same and a whitespace-only line becomes empty.
