How string trim lines works
This tool processes a block of text one line at a time. It trims the leading and trailing whitespace from every line, so indentation and stray spaces at the end of each line are removed without flattening the whole block into a single line.
Two options control the behaviour. "Drop blank lines" removes any line that becomes empty after trimming, which is ideal for tidying up copied code, CSV output, or pasted text padded with blank rows. "Collapse internal spaces" squeezes runs of spaces and tabs inside each line down to a single space, normalising messy spacing without destroying the line structure.
Everything runs locally in your browser. Nothing is uploaded, so it is safe to paste sensitive text. The result shows the original and final line counts plus the number of blank lines dropped, and you can copy the cleaned block from the result panel.