Where extra spaces come from
Most spacing problems are not typing mistakes. They appear when text moves between programs that store layout differently.
Copying from PDFs
A PDF stores where each line sits on the page, not where paragraphs begin and end. When you copy, you often get a hard line break at the end of every visual line, and sometimes extra spaces where the text was justified.
Old typing habits
Many people were taught to put two spaces after a full stop. Current style guides, including APA and Chicago, ask for one, so editors routinely remove the second.
Web pages, emails and OCR
- Text copied from a web page can bring tabs and indentation from the layout.
- OCR output from image to text tools often has irregular spacing between words.
Fixing text copied from a PDF
PDF text usually needs two fixes: collapsing spaces and rejoining lines.
One paragraph
Paste the paragraph and click Remove Line Breaks. Every line break and run of spaces becomes a single space, giving you one clean paragraph ready to paste into a document or CMS.
Several paragraphs
Remove Line Breaks joins everything, including paragraph breaks, so a long passage becomes one block. To keep paragraphs, fix them one at a time, or use Remove Extra Spaces alone and rejoin lines by hand where needed.
When not to remove spaces
Whitespace sometimes carries meaning, and collapsing it can break things.
Code and indentation
Remove Extra Spaces turns tabs and leading indentation into nothing at line starts and single spaces elsewhere. That ruins Python code and YAML files, where indentation matters. Use a code editor's formatter instead.
Non-breaking spaces
Text from websites and Word often contains non-breaking spaces, which look normal but keep two words on the same line. Remove Extra Spaces does not touch them, so a stubborn gap may be one. Remove Line Breaks and Remove ALL Spaces do catch them.
Aligned columns
Plain-text tables padded with spaces will lose their alignment. For other cleanups, the text tools page has every transform.