Trim Lines
Remove leading and trailing whitespace from every line.
Try a small example
Try a small example
Load the example into an empty form, then run the tool. Or paste your own text.
Example input
Ada Sam
Expected output
Ada Sam
Removes whitespace at the start and end of each line. Internal spaces and line breaks are preserved.
The example is unavailable until the tool is ready.
Text is processed in your browser.
Share this tool
Only the tool’s public link is shared. Your inputs and results stay here.
Show link to copy manually
Quick answer
Remove leading and trailing whitespace from each line separately.
The page and its assets load from the site; this operation uses your entered values only in this browser and does not send them to a calculation endpoint.
How to use it
Paste text and run the tool to remove leading and trailing whitespace from every line. Spaces and tabs inside a line are unchanged; original LF, CRLF or CR line breaks and a final line break are preserved. Trimming can change code indentation.
Limits
Indentation is meaningful in some code and data formats; inspect the result before using it.
Frequently asked questions
Which characters are trimmed?
Leading and trailing whitespace is removed from each line, including spaces, tabs and Unicode whitespace. Whitespace inside a line is left alone.
Are code indentation and line endings preserved?
Indentation at the beginning of each line is removed, so check code before using the output. LF, CRLF or CR separators and a final line break are preserved.
