Boneyard Tools

Remove Extra Spaces From Text

Paste text to clean up the spacing. This collapses double spaces and tabs into a single space and trims each line, with options to drop blank lines and shrink big paragraph gaps.

How to remove extra spaces

  1. Paste your text into the box.
  2. Pick your options, such as collapse spaces, trim lines, or remove blank lines.
  3. Copy or download the cleaned text from the result box.

Examples

Collapse double spaces and trim lines

  Hello    world  
  This   has   gaps 
Hello world
This has gaps

Frequently asked questions

What counts as an extra space?

Any run of two or more spaces or tabs is treated as extra. Collapsing turns each run into a single space, so words stay separated but the doubled-up gaps disappear. Single spaces between words are left alone.

Does it remove tabs as well as spaces?

Yes. Tabs are treated as whitespace. Collapsing replaces a run of spaces and tabs with one space, and trimming lines strips both spaces and tabs from each end of a line.

How do I remove blank lines or big gaps between paragraphs?

Turn on remove blank lines to drop every empty line, or use collapse blank lines to keep a single blank line between paragraphs while shrinking larger gaps down to one.

Will my line breaks be kept?

Yes. Line breaks stay in place unless you choose to remove blank lines. Windows, Mac, and Unix line endings are normalized first so the output is consistent everywhere.

Is my text private?

Yes. Everything runs in your browser and nothing is uploaded to a server, so your text never leaves your device.

Related tools