Text Tools

Remove Extra Spaces

All tools

Tidy text copied from PDFs, emails or old documents in one step, with no options to fiddle with.

How it works

Four simple steps

1

Paste messy text

Drop in copy from a PDF, email thread or legacy document.

2

Spaces collapse

Runs of spaces and tabs become one space, and line-end spaces go.

3

Blank lines shrink

Gaps of several empty lines are cut down to a single blank line.

4

Copy the clean text

Copy it or download it as a text file.

Remove Extra Spaces

About Remove Extra Spaces

Text copied out of a PDF often arrives with double spaces between words, odd gaps at the ends of lines and three or four empty lines between paragraphs. Paste it here and the output is cleaned up immediately, ready to drop into a CMS or an email.

The cleanup follows four fixed rules. Any run of spaces or tabs becomes a single space. A space sitting right before or after a line break is removed. Three or more consecutive line breaks are reduced to two, which keeps one blank line between paragraphs. Finally, whitespace at the very start and end is trimmed. There are no settings, and you can copy or download the result.

Because tabs turn into single spaces and line-start spaces are removed, indentation in code or nested lists is flattened. Use a proper formatter for code instead, such as the JSON Formatter for JSON files. The tool also leaves non-breaking spaces alone, which some word processors insert, so a gap that survives cleaning is probably one of those. Line breaks inside a paragraph are kept, so hard-wrapped PDF text still has its breaks.

To drop every blank line rather than keep one between paragraphs, use the Filter non-empty action in Line Tools. If repeated lines are the problem, Remove Duplicates handles that. The text is cleaned by the browser and not uploaded.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

No. Single line breaks are kept exactly where they are. Only runs of three or more breaks are reduced, leaving one blank line between paragraphs.

It is probably a non-breaking space or another special space character, which this tool does not touch. Retype that gap or replace it with Find and Replace.

Yes. Leading spaces and tabs at the start of each line are removed, so indented code, YAML or nested lists lose their structure. Keep code out of this tool.

View more FAQs

Related tools

View all

Uppercase

Convert text to UPPERCASE.

Open

Lowercase

Convert text to lowercase.

Open

Sentence Case

Capitalize first letter of sentences.

Open

Title Case

Capitalize each word.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools