In this article
The usual problems
- Hard line breaks in the middle of sentences – PDFs store each printed line separately.
- Double or triple spaces – from justified text or columns.
- Several blank lines between paragraphs.
- Invisible characters – non-breaking spaces, zero-width spaces and tabs that break searches, forms and code.
- Spaces at the start or end of lines that make lists look ragged.
Invisible characters: the hidden troublemakers
A non-breaking space looks exactly like a normal space but is a different character. Websites use it to stop words splitting across lines. When you paste text containing them into a form, a spreadsheet formula or code, matches fail mysteriously – “John Smith” does not equal “John Smith”. Zero-width spaces are even sneakier: they take up no room at all. Remove Extra Spaces converts or removes both.
How to clean text
- Paste your text into Remove Extra Spaces.
- Collapse multiple spaces into one and remove invisible characters.
- Choose to remove blank lines entirely or collapse them to a single blank line between paragraphs.
- For PDF text, choose “join into one line” to rebuild flowing paragraphs.
- Copy the clean text.
Rebuilding paragraphs from PDF text
Joining everything into one line fixes broken sentences but also merges paragraphs. A practical approach for longer documents:
- Keep blank lines collapsed to one – they mark paragraph breaks.
- Clean each paragraph by joining its lines.
- Or extract the PDF with PDF to Text, which already rebuilds lines and adds paragraph gaps based on the layout.
Other clean-up jobs
| Problem | Tool |
|---|---|
| Repeated header or footer text | Find and Replace it with nothing |
| Hyphenated words split across lines (“informa- tion”) | Find and Replace with regex: find (\w)- (\w), replace with $1$2 |
| Text in ALL CAPS | Case Converter → Sentence case |
| Duplicate lines in a list | Remove Duplicate Lines |
Pasting without formatting
Much of the mess comes with formatting – fonts, colours, links. Use “paste as plain text” to avoid it: Ctrl+Shift+V on Windows and Chromebooks, Cmd+Shift+Option+V on Mac in many apps (or Edit → Paste and Match Style). Then clean the spacing here.
Cleaning text for spreadsheets and forms
Names and codes pasted into spreadsheets often carry a trailing space that stops lookups such as VLOOKUP or XLOOKUP from finding a match. Clean the whole column here before pasting it back. The same applies to online forms that reject an email address or ID number “for no reason” – an invisible space is very often the culprit.
For writers and students
Before you count words or submit text into an online form, clean it. Double spaces and invisible characters can affect character counts and make your text look careless. Afterwards, check the length with the Word Counter.
Your text is processed in your browser and never uploaded.