CountText

Free word, character and text counter

Home › Tools › Remove extra spaces

Remove extra spaces and line breaks

By CountText · Last reviewed November 18, 2026

Paste messy text to collapse repeated spaces, trim lines, tidy extra blank lines, or join everything into one paragraph. Nothing you type is uploaded.

What is removed, and what is left alone

The default options are the ones people usually want when a paste from a PDF, an email or a spreadsheet arrives full of double spaces and ragged line breaks: repeated spaces on a line become one space, spaces at the ends of lines are trimmed, and runs of empty lines are reduced to a single blank line, which is also how CountText recognises a new paragraph. Non-breaking spaces, which often sneak in from web pages, become ordinary spaces so they do not surprise a later word count. The original text stays in the first box until you press “Replace,” so you can compare the two and undo the change with your browser’s own undo if you have already replaced it.

Turn on “Join all line breaks” only when you want a single paragraph (for example, a caption or a form field that should not contain returns). That option replaces line breaks with spaces and then, if collapse-spaces is on, squeezes any double spaces that creates. The zero-width option deletes characters such as zero-width space and the byte-order mark, which can make two words look identical and still count as extra characters. It also removes zero-width joiners, which will break some emoji sequences; leave it off if you care about those emoji. The tool does not change words, punctuation or case, and it does not “correct” spelling.

Frequently asked questions

Does this change my words?

No. It only adjusts spaces, tabs, line breaks and, if you choose, a few invisible space characters.

What is a paragraph on CountText?

A new paragraph starts when there is at least one blank line in between. That is the same rule as the homepage counter.

Will removing zero-width characters break emoji?

It can. Zero-width joiners are what hold some family and profession emoji together. Leave that option off if you need those emoji intact.