Skip to content
ToolsOnDuty
Text Tools

Text Trimmer

Trim whitespace from each line or the whole text and collapse extra inner spaces.

Free foreverRuns in your browserNo sign-up
Trim options

About the Text Trimmer

This text trimmer removes unwanted whitespace from your text so it is clean and consistent.

Trim both ends of every line, trim only the start or end of the whole text, and collapse runs of inner spaces down to one.

It is handy for tidying data copied from spreadsheets, PDFs and web pages where lines are padded with stray spaces or tabs.

Key features

  • Trim leading and trailing spaces on each line
  • Trim only the start or end of the whole text
  • Collapse repeated inner spaces
  • Copy the cleaned text instantly

How to use

  1. 1Paste your text into the box.
  2. 2Choose which trimming options to apply.
  3. 3Click Trim text and copy the result.

Frequently asked questions

What is the difference between trim each line and trim start of text?
Trim each line removes spaces at both ends of every line. Trim start of text only removes whitespace at the very beginning of the whole block.
Does collapse inner spaces affect line breaks?
No. It only reduces runs of spaces and tabs within a line to a single space; line breaks are kept.
Is my text uploaded anywhere?
No. Trimming happens entirely in your browser, so your text never leaves your device.