Skip to content
ConvertMyStuff
Tool

Trim Lines

Trim leading and trailing whitespace from each line of text.

Text Tools

What this tool does

Remove leading and trailing whitespace from every line while preserving line breaks.

How to use

  1. Paste text with extra spacing into the input area.
  2. Review trimmed output line by line.
  3. Copy the cleaned text for reuse.

Examples

Spaced list items

Input: apple banana orange

Output: apple banana orange

Spaces before and after each line are removed.

Common use cases

  • Normalize pasted code or config snippets
  • Clean CSV or TSV exports before processing
  • Fix inconsistent indentation in lists

FAQ

Does this remove empty lines?

No. Use Remove Empty Lines to drop blank rows entirely.

Are tabs trimmed too?

Yes. Leading and trailing tabs and spaces are removed.

Will internal spacing change?

Spaces between words on the same line are preserved.

Does this affect blank lines?

Blank lines are preserved; only leading and trailing whitespace on each line is removed.

Browse all tools →

Last reviewed: 2026-05-23