How to remove line breaks from text
- Paste the text. Insert example loads a block copied from a PDF.
- Choose what replaces each break: a space for normal prose, nothing for text that was split mid-word, a comma and space to turn a list into one line, or your own separator.
- Tick Keep paragraphs if blank lines should stay as paragraph gaps.
- Copy the result or download it as .txt.
This works for hard line breaks typed or pasted into the box. Windows (CRLF), old Mac (CR) and Unix (LF) endings are all handled.
Fix text copied from a PDF or an email
PDFs and plain-text emails hard-wrap every line at a fixed width. Pasted into a document, the text breaks in the middle of sentences. Before:
The quick brown fox jumps over the lazy dog. This sentence was copied from a PDF, so every line ends with a hard break and an unfriendly hyphen: inter- national. Second paragraph starts here and also wraps.
After, with every break joined by a space and the hyphenated word repaired (7 breaks before, 0 left):
The quick brown fox jumps over the lazy dog. This sentence was copied from a PDF, so every line ends with a hard break and an unfriendly hyphen: international. Second paragraph starts here and also wraps.
Notice that the blank line between the paragraphs was removed too. To keep paragraphs, tick the option:
The quick brown fox jumps over the lazy dog. This sentence was copied from a PDF, so every line ends with a hard break and an unfriendly hyphen: international. Second paragraph starts here and also wraps.
Hyphens at the end of a line
When a PDF breaks a long word it adds a hyphen: inter- then national. Joining the lines with a space would leave inter- national. With Rejoin words split by a hyphen on, the tool removes the hyphen and glues the halves together when the next line starts with a lowercase letter:
ref- erence
ref- erence
Real hyphenated compounds are the exception. If a line ends with a genuine hyphen, such as well- followed by known, the join gives wellknown. Switch the option off when your text has many of those, or check the result for them.
Turn a list into one line
Joining with a comma and space converts a column of values into something you can paste into a formula, a search box or an email:
red green blue yellow
red, green, blue, yellow
With your own text you can use any separator. A pipe with spaces gives:
A1 | B2 | C3
Pasting spreadsheet cells? Each row is a line, so the same trick turns a column into a single line.
Other jobs that need more than this
For one-off patterns, such as replacing every line break with a tab or deleting a prefix from every line, use find and replace in regular-expression mode and search for \n. To clean a list rather than prose, see remove duplicate lines and sort lines. To see how long the cleaned text is, paste it into the word counter.
Line breaks versus paragraph breaks
A line break ends one line and starts the next. A paragraph break is a blank line, which is two line breaks in a row. Word processors store a paragraph as one long line and wrap it on screen, so pasting from them rarely has the problem. Plain text, PDFs, emails and terminal output wrap by inserting real breaks, and that is what this tool removes.
Which option to use depends on the source. Prose from a PDF: join with a space, keep paragraphs, rejoin hyphens. A column of IDs for a query: join with a comma and space. Text where a line break must vanish without a gap, such as a long URL or a code split across lines: join with nothing. Dialogue or poetry where each line matters: keep the breaks and do not use this tool at all.
Related tools
- Find and replace – for custom patterns, such as swapping one line break for a tab
- Remove duplicate lines
- Sort lines
- Word counter – count the words in the cleaned text
Remove line breaks FAQ
How do I remove line breaks from text?
Paste the text into the box and choose what replaces each break. With A space selected, the lines are joined into flowing text. Copy the result or download it.
How do I remove line breaks but keep paragraphs?
Tick Keep paragraphs. Single line breaks inside a paragraph are joined, and blank lines between paragraphs stay as a gap.
Why does text copied from a PDF have line breaks in every line?
A PDF stores each line separately at a fixed width, so copying keeps those hard breaks. Joining them with a space restores normal flowing text.
Can it fix words split by a hyphen at the line end?
Yes. Rejoin words split by a hyphen removes the hyphen when the next line starts with a lowercase letter. Switch it off if your text has real hyphenated words at line ends.
Does it handle Windows and Mac line endings?
Yes. Windows (CRLF), classic Mac (CR) and Unix (LF) line endings are all treated as line breaks.
Can I join the lines with a comma?
Yes. Choose Comma and space, or My own text to use any separator such as a pipe or a semicolon.
Is my text uploaded anywhere?
No. The text is processed in your browser and is not sent to a server or stored.