Remove Line Breaks
Strip line breaks and newlines from text - join lines, collapse spaces, and clean up in your browser.
- Free, no account
- No watermark
- No usage limit
About the Remove Line Breaks
Paste text that got chopped into a jagged column by hard line breaks, and this pulls the breaks out and rejoins it into clean, continuous lines. Copy a paragraph out of a PDF and you already know the pain. Every line stops dead where the page happened to wrap, so your sentences are broken mid-thought and the whole block is miserable to read or edit.
Most of the free ones get one thing wrong. They swap every break for a space and call it done. That's fine for a paragraph. It quietly wrecks a split URL, an API key, or a long hash, because those are meant to be one unbroken string and you've just jammed a space into the middle of it. This tool lets you pick which one you're rejoining, a space for sentences or nothing at all for machine strings, so you stop getting the wrong answer on half your pastes.
And it all runs in your browser. The text you paste is never uploaded, saved, or logged anywhere. That matters when the thing you're cleaning is a contract, an internal email, or client data you would not hand to a random website. Plenty of the free tools ship your paste straight to their server to process it. Ours never lets it leave your machine.
How to use
- Paste your text into the input box. The cleaned version shows up underneath and updates live as you type or change a setting.
- Pick a mode. Remove all line breaks flattens everything into one continuous run. Remove empty lines only leaves your lines where they sit and just deletes the blank ones.
- Choose what replaces each break, a space or nothing. A space keeps words apart for normal text. Nothing glues fragments back together for something like a split link or key.
- Flip on the cleanups if you want them. Collapse multiple spaces squashes doubled spaces down to one, and trim each line shaves stray whitespace off both ends of every line.
- Copy or clear. Hit copy to send the result to your clipboard, or clear the box to start over. No account, no upload, no wait.
Space or nothing: the choice that actually matters
This one setting decides whether you get clean text or garbage.
Replace with a space when you're rejoining real sentences. A break almost always sits between two words, and if you pull it out with nothing in its place, the last word of one line slams straight into the first word of the next. "quick brown" and "fox jumped" become "brownfox", which helps nobody. Drop a single space where the break was and the paragraph reflows the way it was meant to read. For prose out of a PDF, an email, or your own notes, this is the default and you'll rarely reach for the other one.
Replace with nothing is the opposite move, and it exists for one specific job: a single long token that got wrapped across several lines. A URL, a base64 blob, a SHA hash, an API key. Those are supposed to be one continuous string with no spaces anywhere in them. Join them with a space and you've corrupted the value, it won't resolve or match anything. Join them with nothing and the pieces snap back into the exact string you needed.
The rule I'd give a friend is short. If a person is going to read it, use a space. Machine strings are the exception, join those with nothing. Not sure which you're holding? Try space first. If that's the wrong call, the extra space stands out and you delete it in a second. A missing space is the nastier mistake, the two words fuse into one and you usually don't catch it until something downstream refuses to parse.
The stray carriage return that breaks your import
A line break isn't one single character underneath, and this is exactly where the lazy tools trip. Windows ends a line with two characters, a carriage return and a line feed. Mac and Linux use just the line feed. Really old Mac files use a lone carriage return. You never see any of them on screen, but they're sitting in your text all the same.
A lot of tools miss it. If a tool only strips the line-feed part and ignores the carriage return, you're left with invisible carriage returns scattered through the result. Everything looks fine on screen, then your CSV import throws a parse error or your form field rejects the value and you cannot see why. That orphaned carriage return is the culprit, invisible, which is the worst kind of bug.
This tool catches all three forms in a single pass, so it doesn't matter whether your text came off a Windows PC, a Mac, a Linux box, or a copy-paste jumble of all three. You don't have to know which style you've got, and you're never left picking leftover carriage returns out by hand.
Remove empty lines instead of all of them
Sometimes you don't want a single blob, you just want to close up the gaps. That's the second mode. It keeps every line of real content where it sits and deletes only the blank or whitespace-only lines between them, so a list, a block of notes, or a baggy config file gets tight again without disturbing the lines you're keeping. Pair it with collapse spaces and trim each line and you clear the horizontal mess too, doubled spaces knocked down to one, stray whitespace shaved off the ends.
Where it actually saves you time
Cleaning text out of a PDF is the classic case. Remove all breaks, join with a space, keep the cleanups on, and a chopped column reads like a paragraph again. Forwarded emails are the same story, they wrap at a fixed width and stamp a break at every wrap, so one pass turns a skinny quoted reply back into normal writing.
A few less obvious ones. Prepping text for a database column or a CSV cell that expects one line, where a stray break can split your data across two rows or bounce the entry outright. Collapsing a multi-line SQL query into one line for a command-line tool that chokes on newlines. Rejoining a split link or long token, the nothing-joiner case from earlier.
Because it all runs locally there's no size cap and no upload to wait on. Paste one sentence or a very long document and nothing gets truncated. A huge input might take a second, but that second happens on your own device, privately.
Frequently asked questions
Can it keep my paragraphs separate?
Not as separate paragraphs, no, and it's worth being straight about that. Remove all line breaks flattens the whole thing into one run, blank lines included, so the paragraph gaps go with everything else. If you need those gaps kept, clean one paragraph at a time, or use remove empty lines only, which at least holds each line on its own row instead of merging them. We left out a toggle that tries to guess your paragraph boundaries, because it would guess wrong often enough to quietly mangle your document.
I joined with a space and still got double spaces. Why?
Usually because some of your original lines had trailing spaces before the break, so removing the break leaves a space plus the one you added. Turn on collapse multiple spaces and it knocks any run of two or more down to a single space. Add trim each line on top and the leading and trailing whitespace goes too, which clears the last of the doubled gaps.
Can I flip settings and compare without pasting again?
Yes. Your original stays put in the input box the whole time, and the output is generated fresh from it whenever you change an option. So you can toggle space versus nothing, or switch modes, and watch the result change instantly without re-pasting or losing your source text.
Will it change my actual words or punctuation?
No. It only touches line breaks and whitespace. Every letter, number, and mark of punctuation stays exactly as you pasted it. It rearranges how the text is laid out, not what it says, so you can run it as many times as you want without ever dropping a word.
Does it handle text pasted from Word or Google Docs?
Yes. Text from a rich document comes into the box as plain text carrying its line breaks, and the tool treats those the same as breaks from anywhere else. Bold, fonts, and colors don't survive the paste because they aren't part of the text, only the breaks and spacing are, and those are exactly what gets cleaned.
Is there anything it won't fix?
It won't re-capitalize or re-punctuate a sentence that a bad break split in an ugly spot, and it can't rebuild paragraph structure that a PDF never stored in the first place. It handles the breaks and spacing and leaves the wording to you. For splitting text back apart or swapping specific phrases, a find-and-replace tool is the better fit.