Trim Whitespace from Lines

Clean up copied lists with padding at the start or end of individual lines.

Text inputPreview and copyRuns in your browser

Enter your text

Result

How to use

  1. Paste one record per line when you want to remove spacing at the outside edges.
  2. Select Convert to generate the output.
  3. Review the output before copying it.

How it works

Clean up copied lists with padding at the start or end of individual lines. Trim leading and trailing whitespace separately on each line.

Formula or processing rules

Trim leading and trailing whitespace separately on each line.

Worked example

A line containing two leading spaces before alpha prints as alpha.

Example text lengths in UTF-16 code units
Input · 16
Output · 10
Worked example
MeasureValue
Source text alpha beta
Resultalpha beta

Pros and cons

Pros

Clean up copied lists with padding at the start or end of individual lines. The sample provides an immediate check of the expected output.

Cons

Intentional indentation is removed. Avoid this tool when leading spaces represent nested structure.

Limitations and troubleshooting

Avoid trimming when leading spaces carry meaning, such as indentation in a code sample.

Reduce unwanted internal whitespace

Frequently asked questions

Does trimming align the words inside a line?

Trimming targets leading and trailing whitespace. It does not align columns or edit internal spacing.

What rule does the Trim Whitespace from Lines apply?

Trim leading and trailing whitespace separately on each line.

What should I see in the Trim Whitespace from Lines example?

A line containing two leading spaces before alpha prints as alpha.

What should I verify after using Trim Whitespace from Lines?

Intentional indentation is removed. Avoid this tool when leading spaces represent nested structure.

Is my input stored by the tool?

The transformation is computed in the open page. The tool does not save the submitted text.