Trim Whitespace from Every Line

Removes spaces and tabs at the start and end of each line, plus empty lines at the very beginning and end of the text.

Result

The converted text appears here as you type.

For example
apples   
	bananas
  cherries
apples
bananas
cherries

How to use

  1. Paste or type your text in the box.
  2. Check the result. Every change is highlighted, so you can see exactly what will be different.
  3. Press Copy Result, or Open in Editor to keep working with more tools, undo and saved drafts.

Example

Before
   apples   
	bananas
  cherries  
After
apples
bananas
cherries

What it's for

  • Cleaning a column of values pasted from a spreadsheet
  • Removing indentation from text copied out of code or email

Questions

Does it remove blank lines in the middle?

No. Only the empty lines before the first line and after the last line are removed. Use Remove Empty Lines for the rest.

Related tools