Remove Line Breaks
Remove line breaks from text copied from a PDF, an e-mail or a terminal, keep paragraphs if you want, and rejoin words split by a hyphen at the end of a line.
Up to 500,000 characters. Your text stays in your browser.
A space suits normal text. Choose Nothing when lines were wrapped inside words, or for languages written without spaces.
Yes: blank lines between paragraphs are kept as one blank line and only the line breaks inside a paragraph are removed. No: the whole text becomes one line.
Yes: a hyphen at the end of a line is dropped and the word is joined when the next line starts with a lowercase letter. A real hyphen in a word like "well-known" can be lost this way.
Yes: spaces at the start and end of every line are removed before joining, so no double spaces appear.
- Line breaks removed
- 0
- Paragraphs
- 0
How it works
Paste the text and the result updates as you type. Text copied from a PDF or a plain-text e-mail usually carries a hard line break at the end of every visual line. A PDF describes where each line sits on the page rather than how a paragraph flows, and plain-text mail is wrapped at a fixed width (RFC 5322 recommends at most 78 characters per line). Pasted somewhere with a different width, those breaks cut sentences in the middle. The tool removes them.
The text is processed top to bottom in five steps:
- Splitting. CRLF, LF, CR, U+2028, U+2029 and U+0085 each end a line, and CRLF counts as one break. Blank lines at the very start and end of the text are dropped.
- Blank lines. A line is blank when it is empty or contains only whitespace, including non-breaking and ideographic spaces and the zero-width characters U+200B, U+200C and U+200D. A line that only holds spaces is therefore a blank line, even with trimming off.
- Trimming. With Trim each line on, spaces at both ends of every line are removed before joining, so the indentation of a wrapped line never produces a double space.
- Joining. Each break between two lines is replaced by one space or by nothing, depending on Replace each line break with.
- Hyphens. With Join hyphenated words on, the rules below are applied between adjacent lines.
Single breaks and paragraphs
In most sources a wrapped line ends with one break and a paragraph ends with a blank line. With Keep paragraphs set to No, blank lines simply vanish and the whole text becomes one line. With Yes, the text is cut into paragraphs at every run of one or more blank lines, the breaks inside each paragraph are replaced, and the paragraphs are joined by exactly one blank line. Three empty lines in a row come out as one.
The tool does not guess where a paragraph starts from punctuation or line length. Only blank lines count. A text in which a new paragraph is marked only by an indent comes out as one paragraph.
Space or nothing
A space is right for ordinary text. Choose Nothing when the wrapping happened inside words, or for languages written without spaces between words, such as Japanese or Chinese. With Nothing every break glues its neighbours: the first example below would come out as "The quick brown fox jumpsover the lazy dog and keepsrunning through the field."
Hyphenated words
With Join hyphenated words on, two cases are handled between lines that follow each other directly:
- Soft hyphen (U+00AD) at the end of a line. It is an invisible hint where a word may be split. It is dropped and the lines are joined with nothing. This is always safe.
- A hyphen after a letter, next line starting with a lowercase letter. The hyphen is dropped and the lines are joined with nothing: "exam-" and "ple" become "example". Accented letters count too, so "Stra-" and "ße" become "Straße".
In every other case the hyphen stays and the break is replaced as usual: a hyphen after a digit, a space or another hyphen, a next line starting with a capital letter, digit or quote, and any hyphen before a blank line.
Examples
| Input lines | Settings | Result |
|---|---|---|
| The quick brown fox jumps over the lazy dog and keeps running through the field. | Defaults | The quick brown fox jumps over the lazy dog and keeps running through the field. (2 breaks removed) |
| Dear Sam, thanks for the update. (empty) I will send the file tomorrow morning. | Keep paragraphs: No | Dear Sam, thanks for the update. I will send the file tomorrow morning. (4 removed, 1 paragraph) |
| Dear Sam, thanks for the update. (empty) I will send the file tomorrow morning. | Keep paragraphs: Yes | Dear Sam, thanks for the update. (empty) I will send the file tomorrow morning. (2 removed, 2 paragraphs) |
| ab cd ef | Replace with: Nothing | abcdef |
| 今日は天気が よいので、 散歩に行きます。 | Replace with: Nothing | 今日は天気がよいので、散歩に行きます。 |
| exam- ple text | Join hyphenated: Yes | example text |
| exam- ple text | Join hyphenated: No | exam- ple text |
| inter + soft hyphen national | Join hyphenated: Yes | international |
| well- known | Join hyphenated: Yes | wellknown (the real hyphen is lost) |
| pre- and post-war | Join hyphenated: Yes | preand post-war |
| e- | Join hyphenated: Yes | e- Mail (next line is uppercase, hyphen stays) |
| range 1- 2 | Join hyphenated: Yes | range 1- 2 (hyphen follows a digit) |
| "one" + 1 trailing space 1 leading space + "two" | Trim each line: Yes | one two |
| "one" + 1 trailing space 1 leading space + "two" | Trim each line: No | one, three spaces, two |
| Shopping list - eggs - milk (empty) Notes Buy early | Keep paragraphs: No | Shopping list - eggs - milk Notes Buy early |
| Shopping list - eggs - milk (empty) Notes Buy early | Keep paragraphs: Yes | Shopping list - eggs - milk (empty) Notes Buy early |
How the counts work. In the Dear Sam text there are 4 breaks in the input. With Keep paragraphs off all 4 are removed. With it on, the two breaks that make up the blank line stay, so 2 are reported as removed and the result has 2 paragraphs. If the input had three blank lines in a row, that would be 4 breaks, 2 of them kept and 2 counted as removed, because the extra blank lines collapse.
Things to watch for
- Headings and bullets are glued to the next line. A break after a heading or a list item is removed like any other, as the shopping list shows. Keep paragraphs helps only when blank lines separate the blocks; bullets that follow each other without blank lines are still joined into one line.
- No sentence detection. A break after a full stop is removed the same as one in the middle of a sentence, so the next sentence starts after a space. The tool does not look at punctuation, capital letters or line length to decide what is a paragraph.
- A blank line after every line. Some sources paste with an empty line between all lines. Leave Keep paragraphs on No in that case; with Yes every line would become its own paragraph.
- Hyphen joining is a guess. It cannot tell a split word from a compound. Besides "well-known" it also changes suspended hyphens: in "Wirtschafts-" followed by "und Finanzpolitik" the lowercase "und" makes the result "Wirtschaftsund Finanzpolitik". Only the hyphen-minus and the soft hyphen are recognised; an en dash or a non-breaking hyphen at the end of a line is treated like any other character. Read the result once when the option is on.
- A kept hyphen still gets a space. When the next line starts with a capital, "Mont-" followed by "Blanc" becomes "Mont- Blanc". Fix such cases by hand.
- Words split across a blank line are not joined. A hyphen before a blank line always stays.
- Inside a line nothing changes. Tabs and runs of spaces in the middle of a line are kept, and so is every letter.
- Output uses LF. Even if the input used CRLF, the blank lines between kept paragraphs are LF only.
Frequently asked questions
Last updated: 10/11/2026
Related tools
Remove duplicate lines from a list, keep the first or last occurrence, and ignore letter case, surrounding spaces and invisible characters if you need to.
Count words, characters, sentences and paragraphs as you type, and see which words you use most.
Compare two texts and see which lines or words were added, removed or left unchanged, with options to ignore case and spacing.