Remove Line Breaks — clean up copied text in one paste
Text copied from a PDF, ebook or email often arrives chopped into hard line breaks mid-sentence. Paste it here to remove every line break, keep only the paragraph breaks, or replace breaks with any character — live, as you type, with nothing uploaded.
Examples library
Real-world messy text to try — click one to load it with the mode that suits it.
Your session
History, favorites and recently used tools live in this tab's memory only — nothing is uploaded or stored, and everything clears when you close the tab.
Your tools
Star a tool to favorite it; tools you chain into are marked as recently used.
How to remove line breaks from text
- Paste your text into the input box.
- Choose a mode: remove all line breaks, keep paragraph breaks, or replace breaks with a custom character.
- Copy the cleaned result or download it as a .txt file.
Worked example
Pasted from a PDF, this passage has a hard break at the end of every printed line — 7 lines, 130 characters, 24 words, with 6 line breaks:
With Keep paragraph breaks, the 4 single breaks inside the paragraphs become spaces and the blank line between the paragraphs survives — still 130 characters, now on 3 lines:
With Remove all breaks, all 6 breaks are removed and the passage becomes a single flowing block of text.
Which mode should you use?
| Mode | What it does | Best for |
|---|---|---|
| Remove all breaks | Every line break is removed, including blank lines — the output is one block of text. | Pasting into a spreadsheet cell, a form field, a subtitle or anywhere line breaks break the layout. |
| Keep paragraph breaks | Single breaks inside a paragraph become spaces; blank lines between paragraphs stay. | Fixing PDF, ebook and email text you want to read or edit as normal prose. |
| Replace with… | Each break is swapped for text you choose — a comma, a semicolon, a space, or nothing. | Turning a list of lines into a comma-separated list, or joining lines into a single string for code or data. |
Two finishing options apply to every mode. Collapse extra spaces squeezes runs of spaces (left behind where blank lines and indentation were) down to one. Trim each line removes leading and trailing spaces on each line before the breaks are handled, so indented PDF lines join cleanly.
Line break cheat sheet
Keep the equivalents for Word, Excel, Google Sheets, regex, JavaScript and Python next to your desk — every recipe on this page, in one small text file.
Why copied text is full of line breaks
A PDF doesn't store flowing paragraphs — it stores printed lines at fixed positions. When you copy from one, each visual line ends with a real line-break character, and your word processor treats it as the end of a paragraph. Emails from some clients, ebooks, and text extracted from images with OCR have the same problem. Removing the breaks inside each paragraph and letting your editor re-wrap the text is the standard fix.
Frequently asked questions
How do I remove line breaks from text copied from a PDF?
Copy the text from the PDF, paste it into the box above and choose “Keep paragraph breaks”. Hard line breaks at the end of each printed line are replaced with spaces so sentences flow again, while blank lines between paragraphs are preserved. Then copy the result back into your document.
What is the difference between removing all breaks and keeping paragraph breaks?
“Remove all” turns the whole text into a single block — every line break, including blank lines, is removed. “Keep paragraph breaks” only removes the single line breaks inside a paragraph and leaves the blank lines that separate paragraphs intact, so your paragraph structure survives.
Can I replace line breaks with a comma or another character?
Yes. Choose “Replace with…” and type any replacement — a comma and space turns a list of lines into a comma-separated list, a semicolon or a tab works too. Leave the replacement empty to join lines with nothing between them.
Why does copied text have line breaks in the middle of sentences?
PDFs, ebooks and some emails store text as fixed-width printed lines, so every visual line ends with a real line-break character. When you paste that text into a word processor, those hard breaks come with it and chop sentences in two. This tool replaces those breaks with spaces to restore the natural flow.
Is my text saved or uploaded anywhere?
No. The cleanup happens entirely in your browser as you type; nothing is uploaded, stored or tracked.
How do I remove line breaks in Word or Excel instead?
In Word, use Find & Replace (Ctrl+H), search for ^p (paragraph mark) or ^l (manual line break) and replace with a space. In Excel, use =SUBSTITUTE(A1,CHAR(10)," ") to swap line breaks for spaces. For a one-off cleanup without formulas, this page does the same job in one paste.
Related text tools
About this tool
The Remove Line Breaks tool is one of 33 free utilities in the Online Utilities Suite at dev.conversiontools.online. Every tool runs entirely in your browser — your text is never uploaded, stored or tracked — so cleanup is instant and private, even on long documents.
Privacy
This page processes everything locally in your browser: no account, no uploads, and nothing you type is sent to a server. The optional session snapshots in “Your session” live only in this tab's memory — never in browser storage — and are gone for good when you close the tab. Advertising on this site is served by Google AdSense, which may use cookies to personalize ads; you can opt out of personalized advertising in your Google ad settings.