Trim Lines

Use Trim Lines to clean whitespace around every line in a block of text while preserving the original line structure.

Input

Paste multi-line text here...

0 characters 0 lines

Output

Trimmed lines will appear here...

0 characters 0 lines

How it works

Use Trim Lines to clean whitespace around every line in a block of text while preserving the original line structure.

This page runs directly in the browser so users can paste, process, and copy the result without leaving the site.

Common use cases

  • Clean copied lists before validation or import.
  • Normalize line endings before de-duplication.
  • Prepare pasted content for spreadsheets or scripts.

Frequently asked questions

Does this remove spaces inside a sentence?

No. It only removes whitespace from the start and end of each line.

Will it preserve empty lines?

Yes. Empty lines stay in place; only leading and trailing whitespace is trimmed.

Example

A quick example of how this tool works.

Input

  first line  
	second line	
  third line

Output

first line
second line
third line

How to use

Paste the block, trim each line, then copy the cleaned result.

  1. Paste the line-based text that has extra spaces or tabs at the edges.
  2. Click Trim Lines to clean every line without changing the order.
  3. Copy the output back into your editor, config, or spreadsheet.

Use cases

This helps when the content is fine but each line carries messy edge whitespace.

  • Clean copied code snippets or config lists before reuse.
  • Fix line-based data before comparing it in diffs or reviews.
  • Remove accidental edge spaces from pasted content blocks.

Example

A quick example of how this tool works.

Input

Sample input for Trim Lines

Output

Processed output from Trim Lines