Text Cleaner — Remove Line Breaks & Extra Spaces
Paste your text, tick the options, and the cleaned result updates instantly.
Your last settings were restored.
Your text is not sent to a server. It is processed inside your browser.
How to use
How the text cleaner works
Copying text from a PDF, an email, a web page or a chatbot often brings along mess you did not ask for: a line break at the end of every line, double spaces, tab characters, stray bullets and characters you cannot even see. This text cleaner fixes that in one step. Paste your text on the left, tick the cleanups you want, and the cleaned version appears on the right straight away. A before-and-after count shows how many characters, characters without spaces and bytes were removed, and the Copy result button puts the clean text on your clipboard. Your last settings are remembered in this browser, so the options you use most are ready next time.
What each option does
- Remove line breaks joins all lines into one flowing paragraph by turning each line break into a single space. This is the option to use for text copied from a PDF or from an email where every line ends with a hard return.
- Keep blank lines (paragraphs) works together with the first option. It joins the wrapped lines inside each paragraph but keeps a blank line between paragraphs, so your structure survives. It is only available when line-break removal is on.
- Collapse repeated spaces replaces two or more spaces or tabs in a row with a single space.
- Trim spaces at line start and end removes leading and trailing spaces on every line, which is handy for indented code, pasted tables and email replies.
- Remove tab characters turns each tab into a space. Combine it with collapsing spaces to flatten tab-separated columns into a single line.
- Remove bullet symbols deletes a bullet or dash at the start of a line, such as •, ·, –, ◦ or *, together with the space after it. Only line starts are touched, so a hyphen inside a sentence is safe.
- Remove invisible characters strips zero-width spaces, zero-width joiners and the byte-order mark, and converts non-breaking spaces into ordinary spaces. These hidden characters make text look fine but break searches, code, spreadsheet formulas and password fields.
- Remove special characters keeps letters in any language, numbers, spaces and basic punctuation (periods, commas, exclamation and question marks, parentheses, quotes, percent signs and hyphens) and deletes everything else, including emoji and decorative symbols.
The order the cleanups run in
The cleaner first standardizes Windows, Mac and Linux line endings, then applies the options in a fixed order: invisible characters, tabs, bullets, trimming, special characters, line breaks and finally repeated spaces. The order matters. For example, bullets are removed before trimming so that an indented bullet is caught, and line breaks are joined before spaces are collapsed so that the space created by a joined line does not double up. Knowing this helps if a result is not what you expected: change one option at a time and watch the output.
Common situations and the settings that fix them
- Text copied from a PDF with a hard return on each line: turn on Remove line breaks and Keep blank lines, plus Collapse repeated spaces.
- A list of items you want on one line: turn on Remove line breaks and Remove bullet symbols, and leave Keep blank lines off.
- Pasting into a spreadsheet cell or a form field that rejects odd input: turn on Remove invisible characters and Remove tab characters.
- Cleaning up an email thread or chat export: turn on Trim spaces and Collapse repeated spaces.
- A word hyphenated across two lines in a PDF (for example “exam-” then “ple”): the cleaner does not know it is one word. After joining, search for “- ” and repair these by hand.
Why hidden characters cause real problems
A zero-width space is exactly what it sounds like: a character with no width, so you cannot see it. It sneaks into text copied from web pages and chat apps, and it can make a file name invalid, make two identical-looking words fail a match, or make a coupon code get rejected. Non-breaking spaces look like normal spaces but are a different character, so a search for a normal space will not find them. If you ever see a count of characters that seems too high, or a formula that refuses to match, run the text through the cleaner with invisible characters selected and compare the before-and-after character counts.
A quick before-and-after example
Suppose you copy three lines from a PDF: “The quarterly report shows”, then “steady growth in all”, then “regions this year.” Each line ends with a hard return, so pasting it into an email gives you a ragged block. With Remove line breaks and Collapse repeated spaces ticked, the cleaner returns “The quarterly report shows steady growth in all regions this year.” as one tidy sentence, and the counter shows the character total barely changing because each line break simply became a space.
A note on privacy
Nothing you paste is uploaded. The cleanup is performed by JavaScript running in your own browser, so contracts, medical notes, drafts and other private text stay on your device. The tool only stores your option choices in the browser, never the text.
Frequently asked questions
How do I remove line breaks from text?
Paste the text into the Original text box and keep Remove line breaks ticked. Every line break becomes a space and the cleaned text appears on the right. Turn on Keep blank lines if you want paragraph breaks to stay.
How do I get rid of double spaces?
Tick Collapse repeated spaces. Any run of two or more spaces or tabs is replaced by a single space. It is on by default.
Can this remove spaces between all words?
No. The tool tidies spacing but does not delete the single space between words. If you need all spaces removed, copy the result and use your editor’s find-and-replace to replace a space with nothing.
What are invisible characters, and how do I know I have them?
They are characters that take up no visible space, such as the zero-width space, zero-width joiner and byte-order mark, plus non-breaking spaces that look like ordinary ones. A good sign is a before-and-after character count that changes when you tick Remove invisible characters even though the text looks the same.
Will the Remove special characters option delete accented letters?
No. It keeps letters from any alphabet, including accented Latin letters, Greek, Cyrillic and Korean, plus digits, spaces and basic punctuation. It removes symbols, emoji and other punctuation such as brackets other than parentheses, slashes and the at sign.
Does it work on very large text?
Yes. For inputs over about 20,000 characters the preview waits a fraction of a second after you stop typing so the page stays responsive, and above 500,000 characters you will see a notice that processing can take a moment.
Is my text saved anywhere?
No. Only your checkbox choices are saved in your browser so they are restored next time. The text itself is never stored or sent.