Skip to content

Remove Line Breaks

Replace each break with
Cleaned text —
Line breaks removed
—
Characters before
—
Characters after
—
Words
—

Paste your text and every line break is replaced with a space, so three lines reading one, two and three become the single line one two three. Choose Nothing to rejoin split codes, or Keep paragraphs to remove only the wraps inside each paragraph while blank lines stay.

About this tool

Text copied out of a PDF, an old email or a terminal arrives with a hard break at the end of every visual line. Pasted into a web form, a document or a spreadsheet, it stays chopped up. This page removes those breaks and handles Windows CRLF, old Mac CR and Unicode line separators alike, counting each pair as one break. You can join everything into one line, delete breaks outright for codes and URLs, or keep paragraph gaps so a multi-paragraph quote stays readable. Repeated spaces left over from indented lines can be collapsed too. One limit: a hyphen that a PDF added to split a word is left in place, because a script cannot tell it apart from a real hyphenated word.

How to use it

  1. Paste or open the text

    Paste into the box or open a .txt file from your device; it is read locally.

  2. Pick a replacement

    A space joins lines, Nothing deletes the breaks, Keep paragraphs preserves blank lines.

  3. Tidy spacing

    Leave the collapse box ticked to squeeze runs of spaces and tabs into one space.

  4. Copy the result

    Check the break count and character totals, then copy the cleaned text.

Examples

Three short lines

Text with line breaks
one two three
Replace each break with
A space
Collapse repeated spaces and tabs
Yes

Result Cleaned text: one two three
Line breaks removed: 2
Characters before: 13
Characters after: 13
Words: 3

  1. Found 2 line breaks (LF, CRLF, CR and Unicode line separators).
  2. Each break was replaced with one space and the edges of each line trimmed.
  3. Runs of spaces and tabs were collapsed to one space.

Two breaks become two spaces, giving a single 13-character line.

A code split across lines

Text with line breaks
ABCD- EFGH
Replace each break with
Nothing
Collapse repeated spaces and tabs
No

Result Cleaned text: ABCD-EFGH
Line breaks removed: 1
Characters before: 10
Characters after: 9
Words: 1

  1. Found 1 line break (LF, CRLF, CR and Unicode line separators).
  2. Each break was deleted, joining the lines directly.

A Windows CRLF break counts as one break; deleting it rejoins the code without a gap.

PDF paragraphs

Text with line breaks
First line wraps here. Second para.
Replace each break with
Keep paragraphs
Collapse repeated spaces and tabs
Yes

Result Cleaned text: First line wraps here.

Second para.
Line breaks removed: 1
Characters before: 38
Characters after: 36
Words: 6

  1. Found 3 line breaks (LF, CRLF, CR and Unicode line separators).
  2. Single breaks became spaces; blank lines were kept as 2 paragraphs.
  3. Runs of spaces and tabs were collapsed to one space.

The wrap inside the first paragraph goes, the blank line between paragraphs stays, and the triple space shrinks to one.

How it is calculated

output = lines joined by the chosen separator; breaks removed = breaks in input − breaks kept

break
LF, CR, a CRLF pair, form feed, vertical tab, NEL, U+2028 or U+2029
separator
one space, an empty string, or a space inside paragraphs with a blank line between them

Every break form is first normalised to a single line feed, so a Windows CRLF pair is one break, not two. In space mode each line is trimmed and the lines are joined with one space. In paragraph mode the text is split at blank lines, the lines inside each block are joined with spaces, and blocks are rejoined with one blank line, so those breaks are kept and not counted as removed.

When not to use it

  • Poems, addresses and code depend on their line structure and lose meaning when joined.
  • CSV data needs its row breaks; removing them merges every record into one row.

Common mistakes

  • Using Nothing on prose, which glues the last word of one line to the first word of the next.
  • Expecting soft hyphens from a PDF to disappear; words split with a hyphen keep it.

Frequently asked questions

Why does my PDF text have a break at the end of every line?

PDFs store text as positioned lines, not flowing paragraphs. When you copy, most viewers insert a hard break wherever the page wrapped, so a paragraph of eight printed lines pastes as eight separate lines.

Is a Windows line ending counted as one break or two?

One. Windows ends lines with a carriage return followed by a line feed. The pair is treated as a single break, so the count matches the number of lines minus one.

How do I keep paragraphs but remove the wrapping?

Choose Keep paragraphs. Any blank line marks a paragraph boundary and is kept as one empty line, while the single breaks inside each paragraph become spaces.

When would I replace breaks with nothing?

For strings that were never meant to contain spaces, such as a long URL, a licence key or a base64 block that an email client wrapped. Deleting the breaks restores the original string.

Does it change anything other than the breaks?

Leading and trailing spaces on each line are trimmed in space and paragraph modes, and with the collapse box ticked, runs of spaces or tabs shrink to one. Letters, punctuation and hyphens are left untouched.

Is my text uploaded?

No. The text and any file you open are processed in your browser and are not sent to a server.

Cite this tool

Using this tool in an assignment, article or report? Copy a citation, or a link for your website.

APA

Tools Directory Editorial Team. (2026, October 9). Remove Line Breaks. Tools Directory. Retrieved October 26, 2026, from https://tools.milunir.com/text-tools/text-utilities/remove-line-breaks/

MLA

Tools Directory Editorial Team. “Remove Line Breaks.” Tools Directory, 9 Oct. 2026, https://tools.milunir.com/text-tools/text-utilities/remove-line-breaks/. Accessed 26 Oct. 2026.

Chicago

Tools Directory Editorial Team. “Remove Line Breaks.” Tools Directory. Last modified October 9, 2026. Accessed October 26, 2026. https://tools.milunir.com/text-tools/text-utilities/remove-line-breaks/.

Link<a href="https://tools.milunir.com/text-tools/text-utilities/remove-line-breaks/">Remove Line Breaks – Tools Directory</a>