Consecutive Space Finder

Find runs of two or more ordinary spaces in pasted text and optionally collapse them to one space.

← Text Tools

Find runs of two or more ordinary spaces in pasted text and optionally collapse them to one space.

TextWhitespaceBrowser processing

Result: Enter text to inspect spaces.

How to find and collapse extra spaces

  1. Paste plain text into the input.
  2. Select Find Consecutive Spaces to see the count, locations and cleaned preview. Collapse Spaces produces the same preview.
  3. Review the output, then select Copy Cleaned Text. Copy always processes the current input. Reset clears the form.

For example, red blue green has two runs containing five spaces in total. Three are extra spaces, so the cleaned result is red blue green. A single space between words is left alone.

Read the match locations

Lines and columns start at 1. The list shows the beginning and length of each run, up to the first 50 matches. The count and cleaned output still include every run. Columns count UTF-16 code units: an emoji may occupy two or more units, and a tab counts as one unit rather than its displayed width.

The input accepts up to 100,000 UTF-16 code units. Ordinary spaces at the beginning or end of a line are included; the tool collapses a run to one space instead of trimming it completely. Line breaks remain line breaks. Pasting into a browser textarea may normalize the original file’s line-ending format.

What counts as a consecutive space?

This tool looks for runs of two or more ordinary U+0020 space characters. Tabs, line breaks, non-breaking spaces and other Unicode whitespace are not treated as ordinary consecutive spaces.

Formatting note

Collapsing spaces can change intentionally aligned plain text, code snippets or fixed-width data. Review the cleaned result before replacing your original text.

When should I keep repeated spaces?

Review aligned tables, indented code, fixed-width exports and ASCII art before copying the cleaned text. Their spacing may carry meaning. This tool does not parse a programming language or distinguish an accidental extra space from deliberate formatting.

To check the full text length after cleanup, use the Character Counter. For word totals, use the Word Counter. Tabs and non-breaking spaces require a different cleanup rule and are intentionally preserved here.

Related tools