Writing & Text

How to Remove Line Breaks and Fix Broken Paragraphs

Text copied from a PDF or email often breaks at the end of every line. Here is why it happens and how to join the lines, keep your paragraphs and fix split words.

How to Remove Line Breaks and Fix Broken Paragraphs
Photo by Kaboompics on Pexels

Key takeaways

  • Broken lines come from hard returns: real newline characters stored at the end of each visual line.
  • A line break ends a line. A paragraph break is a blank line. Fixing text means removing the first and keeping the second.
  • Choose the mode that keeps paragraph breaks when your source has blank lines between paragraphs.
  • Lists, poems, addresses and code need their line breaks, so do not join them.
  • Always read the result once: split words, stray bullets and double spaces may need a quick manual fix.

To remove line breaks, paste your text into a line break remover, pick a mode that turns each line break into a space, and copy the result. If your text has blank lines between paragraphs, pick the mode that keeps them, so only the broken lines inside each paragraph are joined. The Remove Line Breaks tool does this in your browser, and nothing is uploaded.

The quick answer: which fix do you need?

Start by looking at your text. What kind of mess is it? This table matches the problem to the fix.

What you seeWhat is wrongWhat to do
Every line ends early, no blank linesOne long paragraph cut into short linesReplace each line break with a space
Short lines, but blank lines between paragraphsSeveral paragraphs, each cut into linesKeep paragraph breaks, join the rest
A code, key or web address split over linesA single item cut in the middleJoin without adding a space
Words cut with a hyphen at the line endHyphenated word split over two linesJoin the lines, then fix those words by hand
Two spaces between wordsExtra spaces left after joiningSqueeze spaces to one
Odd bullets, fonts or coloursFormatting came along with the copyPaste as plain text first

Most people need the first or second row. The rest of this guide explains why the problem happens and how to handle the harder cases. If you often clean pasted text, you may also like our guide on how to clean up pasted text.

Why text breaks at the end of every line

A computer can store a paragraph in two ways. In the first way, the paragraph is one long run of text. Your screen wraps it to fit the window. If you make the window narrower, the lines wrap in new places. This is called a soft wrap. The text itself has no break in it.

In the second way, a real break character is stored at the end of each line. This is called a hard return or hard wrap. The text now has a fixed line length. If you widen the window, the lines stay short, because the breaks are part of the text.

Hard wraps show up in a few common places:

  • PDF files. A PDF stores each line as a separate piece of text at a set position on the page. When you copy it, you get one line per row of the page.
  • Old plain text emails. Many mail programs wrapped lines at about 72 or 76 characters. Some still do.
  • Scanned documents. OCR software reads the page line by line and keeps the line ends.
  • Ebooks and web pages. Some sources add a break at the end of every printed line.
  • Chat and notes apps. Pressing Enter at the end of each line, out of habit, creates the same effect.

The result is a block of text that looks fine in the source but falls apart when you paste it into a form, a document or a post. Sentences end in odd places. Spell checkers and translation tools see half sentences. Word counts stay the same, but the layout is a mess.

A laptop on a desk with a notebook beside it
Photo by RDNE Stock project on Pexels

Line break or paragraph break? They are not the same

These two terms are easy to mix up. Here is the difference in simple words.

  • A line break is one newline. It moves the text to the next line.
  • A paragraph break is two newlines in a row. It leaves a blank line, and it tells the reader that a new idea starts.

When you fix broken text, you want to remove the line breaks inside paragraphs and keep the paragraph breaks between them. That is the whole job. If the tool removes both, your text becomes one huge block that nobody wants to read.

CRLF, LF and CR: three kinds of newline

A newline is not the same on every system. There are three versions, and you may meet all of them.

NameCharactersWhere it comes from
LF (line feed)One characterLinux, macOS today, most web tools
CRLF (carriage return plus line feed)Two charactersWindows
CR (carriage return)One characterVery old Mac systems, before Mac OS X

The names come from typewriters. The carriage return moved the print head back to the left. The line feed rolled the paper up one line. Windows kept both steps. Unix systems kept only the line feed.

Why does this matter? A weak clean-up tool may remove only one kind, and leave stray characters behind. Text copied from Windows can then show an extra gap when it is moved to another system. A good line break remover treats all three the same. For more on characters you cannot see, read our guide to invisible characters.

Step by step: fix a broken paragraph

Here is a real example. You copy this from a PDF:

The meeting will be held on

Tuesday at the main office. All

staff should arrive ten minutes

early.

(blank line)

Please bring your laptop and

your badge.

Each line above is shown on its own row. The text has two paragraphs, but each one is cut into short lines. Follow these steps.

  1. Open the Remove Line Breaks tool.
  2. Paste your text into the input box.
  3. Open the line breaks menu. You will see three modes: replace with a space, keep paragraph breaks, and join without a space.
  4. Choose Keep paragraph breaks, because this text has a blank line between paragraphs.
  5. Read the result. Then press Copy.

The result is clean:

The meeting will be held on Tuesday at the main office. All staff should arrive ten minutes early.

(blank line)

Please bring your laptop and your badge.

Now compare what each mode does with the same text:

ModeResultGood for
Replace with a spaceEverything becomes one paragraph. Both parts run together.A single paragraph cut into lines
Keep paragraph breaksTwo clean paragraphs with a blank line between themArticles, letters, reports, book pages
Join without a spaceLines are glued with no space, so words may touchCodes, keys and web addresses split over lines

One more point. The "keep paragraph breaks" mode works only when your source has blank lines between paragraphs. Some sources show paragraphs by indenting the first line instead. In that case there is no blank line to keep, so you may need to add paragraph breaks by hand after joining.

Hands typing a document on a laptop
Photo by Thirdman on Pexels

Fixing words split with a hyphen

Printed pages often cut a long word at the end of a line and add a hyphen. For example, the word "document" can appear as "docu-" on one line and "ment" on the next. When you join the lines with a space, you get "docu- ment". That is wrong.

A tool cannot always tell if a hyphen is a real part of a word or only a line-end cut. Think of "well-known". The hyphen belongs there. So most tools keep the hyphen and leave the fix to you.

Here is a quick way to find them.

  1. Join the lines first.
  2. Search the result for a hyphen followed by a space. In a word processor, search for - (a hyphen and a space).
  3. For each match, decide: is it a split word or a real hyphenated word?
  4. If it is a split word, delete the hyphen and the space. "docu- ment" becomes "document".

If your text uses a regular expression search, our guide to find and replace with regex shows how to fix many of these at once. A simple pattern is a letter, a hyphen, a space and a lower case letter. Check each change, because real hyphenated words can match too.

If the lines were joined with no space by mistake, a word split by a hyphen may look like "docu-ment". The same search works: look for hyphens in the middle of words that you know are not hyphenated.

Bullets, numbered lists and double spaces

PDFs cause a few more problems besides line breaks.

Bullets that turn into odd symbols

A bullet in a PDF is often a special symbol. After you paste it, it may become a square, a dot or a question mark. It may also sit on its own line, away from its text. To fix it, remove the symbol and type a plain hyphen or asterisk, or let your editor build a proper list.

Numbered lists that lose their shape

A list such as "1. Mix, 2. Bake, 3. Cool" may arrive with each number on its own line. After you join the lines, the numbers can end up in the middle of a sentence. For lists, do not join the lines at all. Keep one item per line. Only fix the odd break inside a single item.

Double spaces

PDF text often has two spaces in places, and joining lines can add more. Double spaces look odd in a justified paragraph and make search harder. Use the Whitespace Remover to trim spaces at the start and end of lines and to squeeze repeated spaces to one. Run it after you join the lines.

Stray formatting

If the text brings its own font, size or colour, strip it before you do anything else. The Remove Text Formatting tool removes the styling. The Plain Text Converter is useful when you want only the raw characters with no extras. A good habit is to paste into a plain text box first, and fix the lines second.

When you should not join lines

Some text needs its line breaks. Joining it destroys the meaning. Be careful with these.

  • Poems and song lyrics. The line ends are part of the art. Joining them turns a poem into a block of prose.
  • Addresses. A postal address uses one line for each part: name, street, city, code. Joined, it is hard to read and may be rejected by a form.
  • Code. In many languages, a new line ends a statement. In others, comments end at the line end. Joining code breaks it.
  • Lists. Shopping lists, steps and email lists need one item per line.
  • Tables and columns. Text copied from a table often has one cell per line. Joining mixes up the columns.
  • Subtitles and scripts. Each line matches a time or a speaker.

Always keep a copy of the original. If the result looks wrong, you can start again with a different mode. Never overwrite your only copy of a contract, thesis or script.

Common mistakes and quick checks

  1. Using the wrong mode. If your paragraphs vanish, you chose "replace with a space" on a multi-paragraph text. Switch to the mode that keeps paragraph breaks.
  2. Gluing words together. "Join without a space" removes the break and adds nothing. Two words from different lines will touch. Use it only for codes, keys and web addresses.
  3. Skipping the read-through. Tools cannot understand your text. Read the result once from top to bottom. Look for split words, stray numbers and headings that were pulled into the paragraph above.
  4. Cleaning headings with body text. A heading is usually a short line on its own. If you join everything, the heading joins the first sentence. Fix headings by hand afterwards.
  5. Forgetting trailing spaces. Some lines end with a hidden space. After joining, this causes double spaces. Trim spaces as the last step.
  6. Checking only the top of a long text. Problems often start on page three of a PDF, where a table or a footer sits. Scroll the whole result.

A short workflow that works for most documents is: paste as plain text, join the lines and keep the paragraphs, squeeze spaces, fix split words, then read it once more.

Here is a quick size check. Say your PDF text has 24 lines and each line holds about 11 words. That is roughly 264 words. After joining, the word count should stay about the same. If it changes a lot, something went wrong. A word counter is a fast way to check, and you can read how counters work in our guide to word counting.

Where to go next

Try the Remove Line Breaks tool on your own text, then tidy the spacing with the Whitespace Remover. If the text still carries odd fonts or colours, use Remove Text Formatting first. To learn more about tidy text, read how to clean up pasted text and invisible characters explained.

Frequently asked questions

Why does text copied from a PDF have a line break on every line?

A PDF stores each printed line as its own piece of text at a fixed place on the page. When you copy it, you get one line per row, with a real line break at the end of each. The page was never one flowing paragraph. A line break remover joins those rows back into smooth paragraphs that fit any width.

How do I remove line breaks but keep my paragraphs?

Choose the mode that keeps paragraph breaks. Single line breaks inside a paragraph become spaces, while a blank line between paragraphs stays as one blank line. This works when your source has an empty line between paragraphs. If paragraphs are shown only by an indent, add blank lines by hand after joining.

What is the difference between CRLF, LF and CR?

They are three ways to store a new line. LF is one character, used by Linux and modern Mac systems. CRLF is two characters, used by Windows. CR is one character, used by very old Mac systems. A good line break remover treats all three alike, so you do not need to know which one your text uses.

How do I fix words split with a hyphen at the end of a line?

Join the lines first, then search the result for a hyphen followed by a space. For each match, check whether it is a split word, such as "docu- ment", or a real hyphen, such as "well-known". Delete the hyphen and space in split words only. Tools usually leave this step to you because they cannot tell the two cases apart.

Is it safe to paste private text into an online line break remover?

With the ToolsWish tool, the work happens in your browser and your text is not uploaded to a server. That is a useful property for letters, contracts and notes. As a general habit, check how any tool handles data before you paste private text into it, and keep a copy of your original.

Try the tools from this guide

Keep reading

Related guides

All guides