Remove Line Breaks
Join broken lines from PDFs and emails back into paragraphs. Runs in your browser.
About this remove line breaks
This tool removes unwanted line breaks from text and joins the broken lines back into proper paragraphs. It is for anyone who has copied text out of a PDF, an email or a terminal and ended up with a line break every 60 or 70 characters.
You choose how far it goes. Keep paragraphs joins the lines inside each paragraph but leaves the blank lines between them, so the structure survives. Remove all turns everything into one block, which is what you want for a form field, a spreadsheet cell or a list you need as one comma-separated line. Words that were split with a hyphen at the end of a line are glued back together, and doubled spaces are cleaned up on the way.
Once the text is clean, you can check its length in the word counter or tidy its capitals with the Case Converter.
Features
Keep paragraphs or remove every break
In Keep paragraphs mode a blank line marks a new paragraph and everything between blank lines becomes one line. Remove all ignores paragraphs and gives you a single block of text.
Rejoins hyphenated words
PDFs often break a word across two lines with a hyphen, like differ- and ence. The tool joins these into difference when the second half starts with a lowercase letter. A hyphen before a capital, as in Jean- and Luc, is kept and joined without a space.
Join with anything
Lines are joined with a space by default. You can switch to nothing, a comma, a comma and a space, a semicolon, a pipe or your own separator, which turns a column of values into one delimited line.
Bullet lists stay as lists
Lines that start with -, *, • or a number such as 1. or 2) keep their own line in Keep paragraphs mode, so a list in the middle of a paragraph does not get mashed into one sentence.
How to use the remove line breaks
- 1Paste text copied from a PDF, an email or a web page.
- 2Choose Keep paragraphs or Remove all, and what to join lines with.
- 3Copy the joined text or download it as a .txt file.
When to use it
Copying text out of a PDF
PDF text keeps the line breaks of the printed page. Paste it here, keep paragraphs on, and the text reflows into normal paragraphs you can drop into a document or an email. If the PDF is a scan with no text layer at all, run it through PDF OCR first.
Replying to a hard-wrapped email
Older mail clients and mailing lists wrap plain text at about 72 characters. Joining the lines makes the quote readable on a phone, where those fixed breaks leave ragged half-empty lines.
Turning a column into one line
Copy a column of IDs or email addresses from a spreadsheet, choose Remove all and join with a comma and space, and paste the result straight into a search box or a SQL IN list. If the column has repeats, clean it with remove duplicate lines first.
Why does text from a PDF have line breaks everywhere?
A PDF stores text as positioned lines on a page, not as flowing paragraphs. When you copy it, most viewers give you exactly those lines, each ending with a line break. The same happens with text from fixed-width terminals and with plain-text emails that were wrapped by the sender's mail program.
The tricky part is telling a wrapped line apart from a real paragraph break. This tool uses the rule that works for most documents: a blank line means a new paragraph, and a single line break inside a paragraph is just wrapping. If your source has no blank lines at all, every paragraph will merge into one, and the quickest fix is to add a blank line where each paragraph should start and run it again.
Line feed, carriage return and the other break characters
A line break is not one character on every system. Windows files use a carriage return followed by a line feed (CR LF, written \r\n), while macOS and Linux use only the line feed (LF, \n). Very old Mac files used a lone CR. Unicode also has a line separator (U+2028) and a paragraph separator (U+2029) that turn up in text copied from some apps.
The tool treats all five the same way, so you do not need to know which one your text uses. The output uses plain LF line breaks, which every modern editor, browser and spreadsheet reads correctly.
- CR LF (\r\n): Windows
- LF (\n): macOS, Linux, the web
- CR (\r): classic Mac OS before 2001
- U+2028 and U+2029: Unicode separators
How do I remove line breaks in Word or Excel instead?
In Word, open Replace, type ^p^p in Find to protect real paragraph breaks by swapping them for a placeholder like ###, then replace ^p with a space, and finally replace ### with ^p^p. It works, but it takes three passes and it will not rejoin hyphenated words.
In Excel, a line break inside a cell is CHAR(10), so =SUBSTITUTE(A1,CHAR(10)," ") removes it. For a whole document, pasting here is usually faster, and the text stays on your computer because nothing is uploaded. For other search-and-replace jobs, the find and replace tool supports regular expressions.
Why use Mavros
| Mavros | Typical upload sites | |
|---|---|---|
| Keeps paragraphs | Yes, blank lines are kept | Often all or nothing |
| Rejoins hyphenated words | Yes, with a lowercase check | Rare |
| Keeps bullet lines apart | Yes | No, lists get merged |
| Custom separator | Space, comma, pipe, semicolon or your own | Space only |
| Privacy | Runs in your browser, nothing uploaded | Text is often sent to a server |
Tips
- Leave Fix words split by a hyphen on for PDFs, but turn it off for code or lists of hyphenated product codes, where a hyphen at the end of a line is real.
- If paragraphs merge together, your source has no blank lines between them. Add one where each paragraph starts and the tool will keep them apart.
- Use Remove all with Comma + space to turn a pasted column into a ready-made list for a search filter or a SQL IN clause.
Questions
How do I remove line breaks but keep paragraphs?
Choose Keep paragraphs. The tool joins lines that sit next to each other and keeps the blank lines that separate paragraphs. If the result is one giant paragraph, your text had no blank lines, so add them where each paragraph starts.
How do I put all the text on one line?
Choose Remove all. Every line, including the blank ones, is joined into a single line using the separator you pick, which is a space by default.
Does it remove extra spaces too?
Yes, when Collapse repeated spaces and tabs is on, which is the default. Runs of spaces, tabs and no-break spaces become one normal space, and spaces at the ends of lines are trimmed.
What happens to words split with a hyphen?
They are joined. differ- at the end of one line and ence at the start of the next becomes difference. The tool only does this when the next line starts with a lowercase letter, so Jean- and Luc stays as Jean-Luc.
Can I replace line breaks with commas?
Yes. Set Join lines with to Comma or Comma + space. With Remove all, a column of 50 values becomes one line like a, b, c, which you can paste into a filter or a spreadsheet formula.
Is my text uploaded anywhere?
No. The tool runs entirely in your browser, so confidential documents and emails never leave your device. It even keeps working if you go offline after the page loads.