Skip to main content
T

Trim Whitespace

Strip leading and trailing whitespace from text — per-line, full-text, or with extra-space collapsing.

More options
Send output to:
Advertisement

How to use Trim Whitespace

  1. Paste your text.
  2. Choose leading, trailing, per-line, and extra-space options.
  3. Copy.

What is Trim Whitespace?

Whitespace creeps in from pasted text, copy-pasted from PDFs, web tables, or sloppy editing. Trim it cleanly with control over leading/trailing per line or the whole string, with optional collapse of repeated spaces and tabs.

Advertisement

FAQ

What counts as whitespace?
Spaces, tabs, and newlines (when full-text mode is off). Per-line keeps newlines, just trims edges.
Does it modify my original text?
Nothing is modified on a server or stored anywhere. The tool processes text in your browser, and the result appears in the output field for you to copy.
Can I collapse multiple spaces into one?
Yes. There's an option to collapse runs of extra spaces within lines down to single spaces, along with trimming leading and trailing whitespace.

Related tools

Advertisement