✂️ Text Trimmer

Trim leading and trailing whitespace from text. Remove extra spaces and clean up formatting — all in your browser, no upload, instant results.

About the Text Trimmer

This text trimmer runs entirely in your browser. Type or paste text into the input box, choose the cleanup options you want, and click Trim to clean up whitespace. Nothing is uploaded to a server — the conversion happens instantly with JavaScript on your device.

Options

  • Trim each line — Removes leading and trailing whitespace from every line. (On by default.)
  • Collapse multiple spaces — Replaces runs of consecutive spaces and tabs within each line with a single space.
  • Remove empty lines — Drops any lines that are empty or contain only whitespace after trimming.

How to use the tool

  1. Paste or type your text in the input box.
  2. Tick the cleanup options you want to apply.
  3. Click Trim to clean up the text.
  4. Click Copy to copy the result, or Clear to start over.

Frequently asked questions

Does this tool upload my text? No. All conversion happens locally in your browser. Your text never leaves your device.

What counts as whitespace? Spaces, tabs, and other whitespace characters at the start and end of each line are removed. Line breaks between lines are preserved unless you enable "Remove empty lines".

Can I combine all options? Yes. All three options can be enabled at once for a thorough cleanup.

Is there a length limit? The only limit is your browser's available memory. Even very long texts trim instantly.