How to use Remove Extra Spaces and Line Breaks
- Paste the messy text into the Text to clean field.
- Set how repeated spaces and blank lines are handled, and whether to join wrapped lines.
- Switch on the tab and non-breaking-space options for text copied from a PDF.
- The cleaned text updates as you change the options. Compare the character and line counts before and after.
Example: Remove Extra Spaces and Line Breaks
Tidy a short block with double spaces, a blank run and a tab.
Options
- Join lines that were split mid-sentence
- Joins a line that starts lowercase or with a digit onto the line above, stopping at a paragraph break or a sentence end. It can merge lines you meant to keep apart.
- Blank lines
- Keep leaves them. The middle setting collapses each run to one so paragraph breaks stay visible.
- Remove spaces at the start of each line
- On by default. Turn it off if leading spaces carry meaning in your source text.
- Keep indentation
- Keeps the original indentation of each line, which helps with code and outlines.
Supported inputs and limits
- Up to 5,000,000 characters and 200,000 lines.
- Every option is independent, and the result lists the order that was applied.
- Joining wrapped lines can merge lines you meant to keep separate.
- Removing indentation cannot be undone after Reset, so keep a copy of the source before you clean it.
- Quick actions choose related options together; review the fields before cleaning.
More details
The paragraph-join preset preserves sentence ends and blank paragraph breaks.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
Characters that arrive from a PDF or a web page
Copied text carries characters you cannot see. A tab stands in for a table column and becomes a space. A non-breaking space looks identical to a normal space but survives a search for ordinary spaces, which is why one stubborn gap remains until the option is on. Mixed line endings come from combining sources; the tool writes one style unless you pick one.
The order the options run in
The result lists the transformations in the order they were applied. Tabs and non-breaking spaces are converted first, then spaces are trimmed, then the blank-line setting runs, and joining wrapped lines happens last. Changing an early option can change what a later option sees.
Questions about Remove Extra Spaces and Line Breaks
Why did two of my lines become one?
Join lines that were split mid-sentence was on. It joins a line that starts lowercase or with a digit, and stops at a paragraph break or a sentence end.
Which blank-line setting keeps my paragraphs?
Collapse repeated blank lines to one keeps a single blank line between paragraphs. Remove all removes blank lines but keeps the ordinary line breaks between nonblank lines.
Why will one odd space not delete?
It may be a non-breaking space, which looks like a normal space but is a different character. Try Replace non-breaking spaces with normal spaces. If the gap remains, inspect the original for other invisible characters.
Can I get the original text back?
Your source stays in the editable field alongside the cleaned result until you edit it or press Reset. Keep a separate copy if you need the original after leaving or resetting the page.