Paragraph breaks
Replace each line break with
1 hyphenated word was rejoined. Turn the option off if a hyphen should stay.
Key takeaways
- With the default settings, the 7-line sample loses 4 line breaks and keeps its 2 paragraphs; Remove all takes out all 6 breaks.
- A blank line marks a paragraph break. Single line breaks inside a paragraph are replaced with a space, nothing or a comma.
- Rejoin words turns some- / times into sometimes, but keeps the hyphen before a capital or a digit, so COVID-19 stays intact.
- Windows (CRLF), Unix (LF), old Mac (CR) and Unicode line separators are all handled, and nothing leaves your browser.
How to use the Remove Line Breaks
- 1Paste your text into the first box. The clean version appears below straight away.
- 2Choose Keep paragraphs to keep blank-line breaks, or Remove all to turn everything into one block.
- 3Pick what replaces each line break: a space for prose, nothing for split links or codes, or a comma to turn a list into one line.
- 4Leave Rejoin words and Remove extra spaces on for PDF text, then press Copy text.
Why does text copied from a PDF have line breaks?
PDF text has line breaks because a PDF stores where each line sits on the page, not where each sentence starts and ends. When you copy it, most viewers add a line break at the end of every printed line, so a paragraph that looked neat on the page arrives as a column of short lines in your email or document.
The same thing happens with plain-text emails, which are often wrapped at about 72 to 78 characters, with old subtitle files, and with text copied from terminals or chat apps. Long words may also be split across two lines with a hyphen, which is why the sample on this page contains some- on one line and times on the next. If you need the whole document rather than a few paragraphs, the PDF to Markdown converter rebuilds headings and paragraphs from the file itself.
How to remove line breaks from text but keep paragraphs
To remove line breaks but keep paragraphs, treat a blank line as the real paragraph break and join everything else. That is what Keep paragraphs does: the text is split wherever an empty line (or a line with only spaces) appears, the lines inside each part are joined, and the parts are put back together with one blank line between them.
Each line is trimmed before joining, so you never get a double space where a break used to be. Lines that only contain spaces are treated as empty. Remove all skips the paragraph step and joins every non-empty line, which suits a title, a single answer you want to paste into a form field, or a list you are turning into a comma-separated value.
Rejoin words handles PDF hyphenation. When a line ends with a letter and a hyphen and the next line starts with a lowercase letter, the hyphen is removed and the two halves are joined. When the next line starts with a capital or a number, the hyphen is kept and the gap is closed instead, because that is usually a real compound such as non-English or COVID-19.
How do I remove extra spaces?
Turn on Remove extra spaces and tabs, and any run of two or more spaces or tabs becomes a single space. Spaces at the start and end of each line are always removed when lines are joined. Non-breaking spaces are left alone, since they are usually there on purpose, for example between a number and its unit.
Copied text can also carry characters you cannot see, such as zero-width spaces or soft hyphens. Those are not spaces in the usual sense, so this tool keeps them. To strip them out, along with stray Markdown symbols from chatbot answers, run the result through the AI text cleaner.
How to remove line breaks in Word, Excel and Notepad++
In Microsoft Word, open Find and Replace, type ^p in Find what and a space in Replace with. ^p is a paragraph mark and ^l is a manual line break (Shift+Enter). To keep real paragraphs, first replace ^p^p with a placeholder such as ###, then replace ^p with a space, then replace ### with ^p^p.
In Excel, a line break inside a cell is character 10. The formula =SUBSTITUTE(A1,CHAR(10)," ") swaps each one for a space. You can also open Find and Replace and press Ctrl+J in the Find what box, which enters a line break. The CLEAN function removes characters 0 to 31, line breaks included, but it adds no space, so the words on either side run together.
In Notepad++, open Replace, set Search Mode to Extended, find \r\n and replace it with a space. In code, text.replace(/\r?\n/g, " ") does the same in JavaScript. This page is faster for one-off jobs, and it handles paragraphs, hyphens and spacing in one pass, which a single find and replace does not.
Worked example
Cleaning the 7-line sample text
The sample is a short passage written the way a PDF copy arrives: 7 lines with 6 line breaks, two paragraphs separated by a blank line, a double space after ended, and the word sometimes split across two lines as some- and times.
With the defaults (Keep paragraphs, Space, Rejoin words and Remove extra spaces on), the 4 breaks inside the paragraphs are replaced with spaces and the 2 breaks that make up the blank line are kept. The result has 2 paragraphs, 1 rejoined word and a single space after ended. Switch to Remove all and all 6 breaks go, leaving one paragraph of 48 words.
Turn Rejoin words off and the result reads some- times, with the hyphen and a space in the middle of the word. That is the right choice only when line-end hyphens in your text are real, such as a list of hyphenated product codes. You can confirm the word count of the cleaned text with the word counter.
Line break characters this tool recognises
Different systems mark the end of a line with different characters. All of them are treated as line breaks here.
| Name | Code point | Escape | Where you see it |
|---|---|---|---|
| Line feed (LF) | U+000A | \n | Linux, macOS, most web pages and apps |
| Carriage return + line feed (CRLF) | U+000D U+000A | \r\n | Windows files, email, HTTP headers |
| Carriage return (CR) | U+000D | \r | Classic Mac OS (version 9 and earlier) |
| Next line (NEL) | U+0085 | none | Text converted from IBM mainframes |
| Line separator (LS) | U+2028 | none | Unicode text from some apps and documents |
| Paragraph separator (PS) | U+2029 | none | Treated as a paragraph break |
Frequently asked questions
How do I remove line breaks from text without losing paragraphs?
Choose Keep paragraphs. The tool treats a blank line as a paragraph break and only joins the single line breaks inside each paragraph, so you keep the structure of the original. If your text has no blank lines between paragraphs, there is nothing to tell the paragraphs apart, and they will be joined into one block.
Why does my text still have hyphens in the middle of words?
Rejoin words only removes a hyphen at the very end of a line when the next line starts with a lowercase letter. A hyphen inside a line, or one followed by a capital or a digit, is kept on purpose. A genuine compound split at a line end, such as well- and known, becomes wellknown, so check those by eye.
Can I turn a list into a single comma-separated line?
Yes. Choose Remove all and set Replace each line break with to Comma. A list of one item per line becomes apple, banana, cherry, with empty lines skipped. To drop repeated items first, run the list through the duplicate line remover.
Does this remove line breaks from bullet points and numbered lists?
Yes, it joins them like any other line, so a list inside a paragraph becomes one sentence with the bullet symbols still in it. Keep a blank line before and after a list so it does not merge into the paragraphs around it, or copy the list out and handle it on its own.
Does the tool work with text from ChatGPT, Claude or Gemini?
Yes. Chatbot answers often break lines in places that look odd once pasted into a form or email. Paste the answer here to join the lines. To also strip Markdown symbols like ** and ##, and hidden characters, use the AI text cleaner afterwards.
Is my text uploaded anywhere?
No. The text is processed by JavaScript in your browser and is never sent to a server, so it is safe for contracts, client emails and other private documents. It also works offline once the page has loaded. Closing or refreshing the page clears both boxes.
Sources
- Unicode Technical Report #13: Unicode Newline Guidelines
- Unicode Standard Annex #14: Unicode Line Breaking Algorithm
- Microsoft Support: CLEAN function
Last reviewed by the ToolsFiesta team.