Trim Whitespace from Lines Online
Normalize copied lines by trimming leading and trailing spaces before the next tool in your workflow.
Quick answer
This page trims leading and trailing whitespace from each line while preserving the line order.
It is useful before dedupe, comparison, quoting, slugifying, or turning copied exports into clean lists.
InputText with uneven spacing
OutputWhitespace-trimmed lines
How to use
- Paste the text with uneven spacing into the input box.
- Optionally remove empty rows after trimming.
- Copy the normalized output.
Common questions this page answers
- How do I trim whitespace from each line online?
- How do I remove leading and trailing spaces from copied values?
- How do I normalize text before deduping or comparing it?
Example input and output
Input
alpha
beta
gamma
Trimmed output
alpha
beta
gamma
FAQ
Does it keep blank lines?
Yes by default. Enable skip-empty if you want blank rows removed after trimming.
Will it change the order of the lines?
No. It only trims whitespace around each line.
What tool should I use next?
Trim first, then dedupe, compare, quote, or join the cleaned values.