How to Use Remove Leading Trailing Spaces: Steps and a Worked Example
Trim spaces from the start and end of every line. This guide shows what to enter, a worked example, and the limits to keep in mind. The Remove Leading Trailing Spaces tool is free, needs no account and runs in your browser.
What you need
- Text
Step by step
- Open the Remove Leading Trailing Spaces tool.
- Fill in Text.
- Read the result, which updates as soon as the inputs change.
Worked example
the tool returns:
first line
second line
third line
How it works
Paste text. Leading and trailing spaces and tabs are removed from each line; spaces inside lines are kept.
Things to keep in mind
Check your inputs, units and any local rules before you rely on the result.
Related tools
If this is not quite what you need, try Remove Extra Spaces, Remove Duplicate Lines or Remove Emoji from Text.