GlobalKit

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:

  1. 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.
  2. 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.
  3. 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.
  4. Joining. Each break between two lines is replaced by one space or by nothing, depending on Replace each line break with.
  5. 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:

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 linesSettingsResult
The quick brown fox jumps
over the lazy dog and keeps
running through the field.
DefaultsThe 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: NoDear 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: YesDear Sam, thanks for the update.
(empty)
I will send the file tomorrow morning. (2 removed, 2 paragraphs)
ab
cd
ef
Replace with: Nothingabcdef
今日は天気が
よいので、
散歩に行きます。
Replace with: Nothing今日は天気がよいので、散歩に行きます。
exam-
ple text
Join hyphenated: Yesexample text
exam-
ple text
Join hyphenated: Noexam- ple text
inter + soft hyphen
national
Join hyphenated: Yesinternational
well-
known
Join hyphenated: Yeswellknown (the real hyphen is lost)
pre-
and post-war
Join hyphenated: Yespreand post-war
e-
Mail
Join hyphenated: Yese- Mail (next line is uppercase, hyphen stays)
range 1-
2
Join hyphenated: Yesrange 1- 2 (hyphen follows a digit)
"one" + 1 trailing space
1 leading space + "two"
Trim each line: Yesone two
"one" + 1 trailing space
1 leading space + "two"
Trim each line: Noone, three spaces, two
Shopping list
- eggs
- milk
(empty)
Notes
Buy early
Keep paragraphs: NoShopping list - eggs - milk Notes Buy early
Shopping list
- eggs
- milk
(empty)
Notes
Buy early
Keep paragraphs: YesShopping 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

Frequently asked questions

Last updated: 10/11/2026

Related tools