Remove Line Breaks
Unwrap PDF and email text into clean paragraphs, strip every break, or join lines with a custom separator — with real paragraph detection.
Unwrap mode is built for PDF and email copy-paste: single line breaks become spaces, but blank lines — real paragraph boundaries — survive.
A paragraph, here, is text with a blank line after it
Unwrap mode splits on two or more newlines in a row. A blank line starts a new paragraph; a single newline is a soft wrap to be removed. That is right for text out of a word processor or a wrapped email, and wrong for text that separates its paragraphs with one newline — which flattens into a single paragraph with no warning.
| Input | You would say | The tool says | Result |
|---|---|---|---|
| Blank line between paragraphs | 2 paragraphs | 2 paragraphs | First para line one line two.\n\nSecond para. |
| Single newline between paragraphs | 3 paragraphs | 1 paragraph | First para line one. Second para. Third para. |
Nothing can warn you about the second row, because a soft wrap and a paragraph break are the same character. The only fix is to put the blank lines in before unwrapping — annoying, and the only thing that could work.
Line endings are settled first, and all three are handled
Before any option runs, the text goes through one substitution that takes Windows CRLF, classic Mac CR and Unix LF to the same convention. It also handles a file that mixes them, which happens more often than it should — usually because two people edited it on different machines.
| Convention | In | Out |
|---|---|---|
| Unix LF | a\nb | a\nb |
| Windows CRLF | a\r\nb | a\nb |
| Classic Mac CR | a\rb | a\nb |
| Mixed in one file | a\r\nb\nc\rd | a\nb\nc\nd |
A lone carriage return becomes one newline rather than two, so classic Mac text does not come out double-spaced. It is one line of code, and it is why nothing downstream has to think about it.
Gaps of two or more all come out the same size
The split is on a run of newlines and the join is a fixed blank line, so five newlines and two newlines are indistinguishable in the output. Deliberate spacing does not survive.
| Newlines between | Unwrapped | |
|---|---|---|
| 1 | a b | soft wrap, removed |
| 2 | a\n\nb | one blank line |
| 3 | a\n\nb | one blank line |
| 5 | a\n\nb | one blank line |
The three modes disagree about blank lines entirely
Given one, blank, two, blank, blank, three:
| Mode | Output | Structure |
|---|---|---|
| Unwrap paragraphs | one\n\ntwo\n\nthree | kept, runs normalised |
| Join everything | one two three | gone |
| Custom separator | one, two, three | blanks dropped, then joined |
Custom mode splits on any run of newlines and discards the blank pieces, so it never sees a paragraph at all — it is a list-joiner wearing the same panel. Worth picking deliberately rather than by whichever was left selected.
One smaller thing: the double-space collapse is the ASCII space only. Two em spaces in the middle of a line survive all three modes.
How to use
- Paste the text with unwanted breaks.
- Choose to unwrap paragraphs or strip every break.
- Check that genuine paragraph boundaries survived.
- Copy the cleaned text.
Frequently asked questions
Why does text copied from a PDF break in odd places?
Because a PDF stores positioned text rather than flowing paragraphs. What looks like a paragraph is a set of separately placed lines, so copying inserts a break at the end of each visual line. The original paragraph structure is not recorded anywhere and has to be inferred.
How does unwrapping tell a real paragraph break from a wrapped line?
By looking at the surrounding context — a blank line, a line ending in a full stop and well short of the others, an indent, or a following line starting with a capital or a bullet. It is heuristic rather than certain, which is why the result is worth reading before use.
What about hyphenated words split across lines?
A justified PDF often breaks a word with a hyphen at the line end. Rejoining should remove the hyphen and close the word up, but genuine hyphenated compounds must keep theirs — and telling the two apart reliably needs a dictionary, so a check of the result is worthwhile.
What is the difference between CRLF and LF?
Two conventions for marking a line ending: Windows uses a carriage return followed by a line feed, while Unix, Linux and macOS use the line feed alone. Mixed endings in one file cause diffs that show every line as changed and text that displays oddly in some editors.
Why do quoted email replies wrap so badly?
Because each reply adds another angle-bracket prefix, pushing the text further right until it wraps at an ever shorter width. After several rounds the result is a narrow ragged column. Stripping the prefixes before unwrapping is the way back.
Can I join lines with something other than a space?
Yes. A comma builds a list from a column of values, a pipe suits a Markdown row, and an empty separator concatenates everything. Joining a column copied from a spreadsheet into a comma-separated list is probably the commonest real use.
🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.