Skip to main content

Remove Extra Spaces

Collapse squeezes internal spaces and tabs after trimming each line. Trim only strips line edges. All deletes spaces and tabs and keeps newlines. Nothing is sent to CZNull.

Rated 4.7 out of 5 based on 418 reviews

Input
Output

How to remove extra spaces

  1. Paste text in Input.
  2. Choose collapse to squeeze repeats, trim to cut line edges only, or all to drop every space and tab.
  3. Read the cleaned text. Newlines stay in every action.
  4. Copy the result. Nothing is sent to CZNull.

Whitespace

Spaces and tabs on each line

CollapseTrim each line, then squeeze runs of spaces and tabs to one space
TrimTrim each line. Internal gaps stay.
AllDelete spaces and tabs. Newlines stay.
TabsTreated with spaces in collapse and all
NewlinesKept in every action
UploadNone

What each action does

Collapse trims a line then replaces two or more spaces or tabs with one space. Trim only runs trim on each line. All removes every space and tab character and leaves line breaks.

Space, tab, and line break

This page does not convert tabs to a width. That is tabs to spaces. Joining lines is remove line breaks. Substituting a string is find and replace. Counts are word count.

Use cases

Pasted paragraphs with double spaces, ragged indented logs you want trimmed, or packing tokens by deleting all spaces while keeping rows.

Limits

Other Unicode spaces are not listed as a separate action. Invalid input is unusual here. Work stays in this tab.

Runs in this browser

The engine reads the textarea on this device. CZNull does not receive the text.

Remove extra spaces questions

Does this page upload my text?
No. The work runs in the page you opened. CZNull does not receive the input.
Does collapse keep one space between words?
Yes, after each line is trimmed. Tabs in the middle squeeze with spaces.
Does all remove newlines?
No. Newlines stay. Spaces and tabs are deleted.
Is this tabs to spaces?
No. Tabs-to-spaces changes indent width. This page removes or squeezes whitespace.
Can I replace a word instead?
Use find and replace for substitutions.
What happens on invalid input?
The status line shows the error. The previous result is cleared.