# Remove extra spaces

URL: https://shahid09.is-a.dev/tools/remove-extra-spaces/
Author: Muhammad Shahid (https://shahid09.is-a.dev/)
Free tool · runs in your browser

Clean up text pasted from a PDF, email or website by removing double spaces, stray tabs and extra blank lines.

**Quick answer:** Paste your text and it is cleaned straight away: repeated spaces become one, spaces at the start and end of lines go, tabs and invisible non-breaking spaces become normal spaces, and runs of blank lines shrink to one. Each option can be switched off, and your words and their order are never changed.

## How to use it

1. **Paste your text.** Text copied from a PDF, website, email or spreadsheet.
2. **Choose what to fix.** Keep the defaults, or switch off any option and decide how to handle blank lines.
3. **Copy the clean text.** The result updates as you type, with a count of what was removed.

## Example

Double spaces, stray spaces at line ends and a run of blank lines are cleaned up:

Input:

```
  Hello    world  



This   is  clean.
```

Output:

```
Hello world

This is clean.
```

## Common errors and how to fix them

- **My indentation disappeared**: Turn off "Trim each line" and "Collapse repeated spaces" to keep spaces at the start of lines.
- **Spaces remain after cleaning**: They may be a rare Unicode character. Check that "Non-breaking spaces to normal" is on, and paste a sample into the [character counter](https://shahid09.is-a.dev/tools/character-counter/) to see what is there.

## Frequently asked questions

### Why does pasted text have extra spaces?

PDFs and websites position text for display, so copying can add double spaces, tabs and line breaks that were never typed.

### What is a non-breaking space?

An invisible character (U+00A0) that looks like a space but stops a line breaking there. It is common in web text and can break searches and spreadsheet formulas.

### Does it remove the spaces between words?

No. One space stays between words. Only repeats are removed.

### Can I remove all blank lines?

Yes. Set Blank lines to "Remove all" to put every line directly after the last, or keep at most one to preserve paragraphs.

### Should I use one or two spaces after a full stop?

One. Major style guides, including APA and Chicago, use one space, and this tool will reduce two to one.

### Will it keep my code indentation?

Turn off "Trim each line", "Tabs to spaces" and "Collapse repeated spaces" to keep it. Those options would otherwise remove the indentation.

### Can I do this in Word instead?

Yes, by replacing two spaces with one using Find and Replace and repeating until none remain. This tool does it in one step and also handles tabs and hidden spaces.

### Is my text uploaded?

No. It is cleaned in your browser and nothing is sent or stored.

### Does cleaning spaces change my word count?

No. Spaces are not words, so the total stays the same in the [word counter](https://shahid09.is-a.dev/tools/word-counter/), but the character counter will show fewer characters.

### How do I clean a list as well as its spaces?

Clean the spaces here first, then use the [duplicate line remover](https://shahid09.is-a.dev/tools/duplicate-line-remover/) to clear repeats and the [text sorter](https://shahid09.is-a.dev/tools/text-sorter/) to put it in order.

## Related

- [Duplicate line remover](https://shahid09.is-a.dev/tools/duplicate-line-remover/)
- [Text sorter](https://shahid09.is-a.dev/tools/text-sorter/)
- [Word counter](https://shahid09.is-a.dev/tools/word-counter/)

## Sources

- [Wikipedia: Non-breaking space](https://en.wikipedia.org/wiki/Non-breaking_space)
- [Wikipedia: Sentence spacing](https://en.wikipedia.org/wiki/Sentence_spacing)
