Skip to main content
CaseSwitch

Remove Line Breaks

Use the CaseSwitch Remove Line Breaks tool to join wrapped PDF, email, or terminal lines into continuous prose. Paste the wrapped text, choose a replacement for newlines (default is a space), and copy the result. Processing stays in this browser.

Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.

Last reviewed: 23 July 2026

Processed locally in your browser. Nothing is sent to a server.

Paste or type text to convert. Output stays empty until there is input.

Character count: 0 · Word count: 0 · Line count: 0

Examples

Default space replacement

Input

line one
line two
line three

Output

line one line two line three

Multiple blank lines also become spaces

Input

para one


para two

Output

para one para two

Leading spaces trimmed after join

Input

  hello  
  world  

Output

hello world

CRLF line endings

Input

one
two
three

Output

one two three

Replacement "" (empty — words glue)

Input

line one
line two

Output

line oneline two

Replacement " - "

Input

a
b
c

Output

a - b - c

How to use

  1. Paste the wrapped PDF, email, or terminal text into the input panel.
  2. Leave Line break replacement as a space for normal prose, or set another separator if you need one.
  3. Copy the joined paragraph into your document or CMS.

What this tool is for

Hard wraps are the enemy of paste-into-Word and paste-into-CMS. Email clients, PDFs, and terminals often break a paragraph into many short lines. This tool replaces newline runs with your chosen string (a space by default), then collapses leftover whitespace and trims the edges so the paragraph flows again.

How it works

Every run of one or more newlines (`\r?\n+`) is replaced with the Line break replacement option (default a single space). After that, any remaining runs of whitespace collapse to one space, and leading/trailing spaces are trimmed. Blank lines between paragraphs are not preserved as paragraph gaps — multiple newlines become the same replacement as a single newline, then whitespace collapse may merge spaces. CRLF (`\r\n`) and bare `\n` are both treated as breaks.

When to use it

PDF copy-paste, OCR output, old plain-text emails, chat logs wrapped at a fixed width, and comments that wrapped at column 80 when you wanted a single string for a CMS or spreadsheet cell.

When not to use it

Do not join poetry, license files, CSV rows, or code where newline is syntax. Do not flatten a numbered list you still need as a list — clean wrapping inside paragraphs only, or use a different tool. If you only need to collapse spaces but keep lines, use the Whitespace Remover instead.

How it compares to related tools

The Whitespace Remover collapses spaces and can keep line structure (preserve line breaks defaults to on). The Duplicate Line Remover is about uniqueness, not wrapping. Find and Replace can target specific break patterns when you need a custom regex pass after joining.

Common mistakes

Joining a numbered list into one sentence. Removing breaks in code. Expecting blank lines to survive as paragraph separators — by default they become spaces too. Setting an empty replacement and gluing words together (“oneline two”).

PDF wraps versus true paragraphs

A PDF often wraps a single paragraph at the visible margin, inserting a newline after every line of text. Those are the breaks this tool removes. A blank line in the source usually meant a real paragraph break in the original document — but this converter still replaces that blank line with your replacement string, so two paragraphs become one flow unless you split them first. If you need to keep paragraph gaps, process one paragraph at a time, or use Find and Replace for a more selective pass.

Replacement option and hyphen artifacts

The default replacement is a single space, which is right for English prose. An empty replacement concatenates lines with no separator — useful only when a break sat inside a word without a hyphen. PDFs also break at hyphens (“e-\ncommerce”); joining may leave “e- commerce” or “ecommerce” depending on the source. A second pass with Find and Replace fixes those artifacts. Empty input produces empty output.

Frequently asked questions

Will paragraph gaps survive?+

Not with the default behavior. Runs of newlines are all replaced with your replacement string (usually a space), so blank lines become part of the same joined flow. Process paragraphs separately if you need gaps.

Why is there a space in the middle of a hyphenated word?+

PDFs often break at hyphens. You may need a second pass with find-and-replace for those artifacts.

What does the replacement option do?+

It is the string inserted wherever a newline run was. The default is a space. You can use a dash, a comma, or an empty string — empty glues the lines with no separator.

Are Windows CRLF line endings supported?+

Yes. Both `\n` and `\r\n` count as line breaks and are replaced the same way.

How is this different from the Whitespace Remover?+

Whitespace Remover can keep lines and only collapse spaces within each line. Remove Line Breaks is specifically for joining lines into one flow.

Is my text uploaded?+

No. Joining runs in this browser. Nothing is sent to a server.

Does CaseSwitch upload this text?+

No. Conversion, cleaning, and counting for this page run in your browser. Drafts are not sent to CaseSwitch for processing.

Related guides

Read our original articles on this topic.

Related tools

Whitespace Remover

Cleaning CSV cells, tightening pasted UI copy, normalizing Slack or email spacing before a character count, and preparing text for a case converter or duplicate-line pass when padding would create false unique lines.

Duplicate Line Remover

Deduping email lists, unique-ifying a keyword list, cleaning a changelog pasted twice, preparing a column for import, and removing repeated headers from a log extract. Use it when duplicates are exact line repeats and you want to keep original order. Pair with the Whitespace Remover first if trailing spaces or mixed tabs make visually identical lines look different to you but not to the tool.

Plain Text Converter

Pasting a README snippet into Slack as plain text, cleaning a CMS export, preparing copy for a system that escapes HTML badly, and getting unstyled words ready for a case converter.

Find and Replace Text

Renaming a term across a draft, normalizing spelling variants, stripping a repeated prefix, fixing a typo that appears dozens of times, and small regex cleanups (optional digits, `colou?r`-style variants, capture-friendly patterns). Test on a short sample before pasting a long document.

Character Remover

Cleaning invoice numbers out of a description, removing emoji from a slug candidate, stripping punctuation before a frequency count, deleting a separator from a pasted column, and preparing a string for a case converter when leftover marks would become part of a token.

Remove Text Formatting

Cleaning chat messages that used *bold*, turning a Markdown outline into a meeting agenda, preparing text for a case converter, and peeling markers from a CMS paste.