Trim lines
Remove leading and trailing whitespace from each line of your text.
Trim lines
Whitespace at the start and end of lines is often invisible but clutters code, data exports and copy–paste results. Paste any text and this tool removes spaces and tabs from the edges of every line while keeping all internal spacing and line breaks intact. " hello world " becomes "hello world" on each line, instantly.
Choose how much to trim. Both sides removes whitespace from the start and end of each line, which is the most common cleanup. Leading only removes spaces before the text, useful when you need to preserve right-alignment or trailing indentation. Trailing only removes spaces after the text, perfect for cleaning up lines that have accidental whitespace tails from export systems or sloppy pasting.
The number of lines stays exactly the same, including blank lines. Windows and Unix line endings are handled identically. The live tally shows how many whitespace characters were removed and how many lines the result has, so you can see the impact of each choice instantly.
Everything runs locally in your browser, so no text is sent anywhere. This makes the tool safe for cleaning up code snippets, SQL queries, CSV exports, log files or any text with invisible whitespace issues. Copy the result, download it as a .txt file, or send it to another tool when you are done.