You copy a paragraph out of a PDF, paste it into an email or a document, and it arrives chopped into short lines, each one ending wherever the original page happened to wrap. Fixing it by hand means clicking at the end of every line, deleting the break and adding back a space - tedious for one paragraph and hopeless for ten pages. Removing the line breaks in one pass turns those fragments back into flowing sentences.
The quickest way is to paste the text into Remove Line Breaks. Every line break is replaced as you type, and the cleaned result appears underneath with a Copy button. The rest of this guide explains where the stray breaks come from, which of the two join options to pick, and the few cases where joining lines needs a little care.
Why copied text is full of line breaks
Most text you read is wrapped by the screen: the words flow to the edge of the window and continue on the next line, but nothing in the text itself marks where the wrap happens. Some formats are different. A PDF stores each line of a page as its own run of text placed at fixed coordinates, so when you copy from it, the viewer has to guess how the lines fit together and usually puts a hard break at the end of each one. Plain-text email traditionally wraps at around 72 characters, and some mail programs insert real breaks there before sending. Text pulled from subtitles, terminals, OCR output and old documents behaves the same way. The breaks are real characters in the copied text, so the app you paste into cannot reflow them.
There are also two kinds of break underneath. Windows marks the end of a line with two characters, a carriage return followed by a line feed, while macOS, Linux and the web use a line feed alone; very old Mac files used a lone carriage return. The tool treats all three the same way, so it does not matter which system the text came from.
How to remove line breaks, step by step
- Open Remove Line Breaks and paste your text into the box.
- Under 'Replace each line break with', choose A space (the default) for ordinary prose, or Nothing to join the lines directly.
- Leave 'Collapse extra spaces' ticked to tidy the gaps left behind.
- Click Copy and paste the result wherever you need it.
Nothing is uploaded. The text is processed in your browser as you type, so it is safe to use on contracts, medical letters or anything else you would rather not send to a website.
A worked example
Say you copy this three-line fragment from a PDF:
- The quick brown fox
- jumps over the lazy
- dog.
With A space selected, each break becomes one space and the result is a single line: The quick brown fox jumps over the lazy dog. If you had chosen Nothing, the words either side of each break would run together into foxjumps and lazydog, which is why a space is the right choice for normal sentences.
Now a messier case, where the original lines had trailing spaces and the next line was indented: 'line one' followed by two spaces, a break, then two more spaces and 'line two'. Replacing the break with a space leaves five spaces in a row between the two phrases. With Collapse extra spaces switched on, any run of two or more spaces or tabs shrinks to a single space and the ends of the text are trimmed, so you get line one line two with one clean gap. Untick it only if the exact spacing matters - for example in aligned columns you intend to keep.
Space or nothing: which to choose
- A space is right for prose: paragraphs from PDFs, emails, web pages, transcripts and OCR output. It puts back the word gap the line wrap replaced.
- Nothing is right when the break cut through something that has no spaces in it: a long URL wrapped across two lines, a Base64 string or API key that was split into fixed-width rows, a serial number, or text in languages such as Chinese and Japanese that do not use spaces between words.
For example, a link that was split after a slash, https://example.com/a/very/long/ on one line and path?id=7 on the next, comes back as one working URL with Nothing selected. With a space it would break at the gap.
Things to watch for
Paragraph breaks are removed too
Every run of line breaks is replaced with one space, including the blank line between paragraphs, so a document with three paragraphs comes out as one block of text. If you need to keep the paragraphs, paste and clean them one at a time, then put the blank lines back yourself. If all you want is to tidy the gaps - collapse several blank lines into one, trim spaces at the ends of lines - without joining anything, the Whitespace Remover does that and leaves your line structure alone.
Hyphens at the end of a line
Typeset text often splits a long word across lines with a hyphen, so exam- ends one line and ple starts the next. The tool joins the lines but does not delete the hyphen: with A space you get exam- ple, and with Nothing you get exam-ple. It cannot safely tell a wrap hyphen from a real one in a word like well-known, so it leaves both alone. After joining, use Find and Replace to replace '- ' (a hyphen followed by a space) with nothing, then check the few genuine hyphenated words it catches.
Lists and line-by-line data
If each line is a separate item - a list of names, email addresses or product codes - removing the breaks merges them all into one line, which is rarely what you want. To clean up a list, keep it one item per line and use Remove Duplicate Lines or Sort Lines instead.
Removing line breaks in other apps
Most editors can do it with a regular-expression search, which is handy if the text is already open there. In Microsoft Word, open Replace, search for ^p (the paragraph mark) and replace it with a space; for manual line breaks the code is ^l. In VS Code, Notepad++ and most code editors, turn on regex mode, search for \n (or \r\n for Windows files) and replace with a space. These all work, but they are easy to get slightly wrong, and none of them collapses the double spaces afterwards. For a one-off paste, the Remove Line Breaks tool is the faster route.
Join your lines now
Paste your text into Remove Line Breaks, pick a space or nothing, and copy the result. It runs entirely in your browser, with no upload and no sign-up.
Frequently asked questions
- How do I remove line breaks from text copied from a PDF?
- Paste it into a line-break remover with each break replaced by a space and extra spaces collapsed. 'The quick brown fox' / 'jumps over the lazy' / 'dog.' becomes 'The quick brown fox jumps over the lazy dog.' on one line. Check any words that were hyphenated across lines, since the hyphen stays in.
- Should I replace line breaks with a space or with nothing?
- Use a space for normal sentences, or the words either side of each break run together. Use nothing when the break split something that contains no spaces, such as a long URL, a Base64 string, a key or code, or Chinese and Japanese text.
- Can I remove line breaks but keep paragraphs?
- Not in a single pass with this tool: every run of breaks, including the blank line between paragraphs, becomes one space. Clean each paragraph separately and add the blank lines back, or use a whitespace cleaner to collapse blank lines without joining the lines themselves.