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 Trim Whitespace from Lines

  1. Paste your source text in the input box.
  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.

Troubleshooting

Check the input format and compare your case with the built-in sample. Intentional indentation is removed. Avoid this tool when leading spaces represent nested structure.

Frequently asked questions

How do I use the text I get back?

Copy the output into the document, list, or compatible tool where you need it.

How does the transformation work?

Trim leading and trailing whitespace separately on each line.

Can I try a sample first?

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

What should I check before using the result?

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.