Skip to content
TextBench Lab

Remove Line Breaks

Paste text that is broken into short lines and get it back as one clean block. Join lines with a space, a comma or your own text, keep real paragraphs, and fix words split by a hyphen. It runs in your browser, so nothing is uploaded.

Replace line breaks with
Options
Lines before
0
Lines after
0
Line breaks removed
0

How to remove line breaks

  1. Paste your text

    Put the text in the top box. It can come from a PDF, an email, a chat, a log file or code.

  2. Choose what replaces each break

    Pick a space, nothing, a comma or your own text. The result updates as you type.

  3. Set the cleanup options

    Keep paragraphs, remove empty lines, trim line ends, collapse extra spaces, or fix words split by a hyphen.

  4. Copy the result

    Check the line counts, then press Copy and paste the clean text where you need it.

Features

  • Every kind of line break

    Handles Windows, Mac, Linux and Unicode line separators, even when they are mixed in one text.

  • Keeps paragraphs

    Join the lines inside each paragraph and leave a blank line between paragraphs.

  • Fixes PDF hyphens

    An opt-in option joins words that a PDF split with a hyphen at the end of a line.

  • Private

    Your text is processed in your browser and never sent or stored.

What this tool does

Some text arrives broken into short lines that you never typed. You copy a paragraph from a PDF, paste it into a form, and every line stops in the middle of a sentence. This tool joins those lines again. Paste your text, choose what should replace each line break, and the clean version appears right away. It works in your browser, so your text stays on your device.

Why line breaks appear

A line break is an invisible character that tells software to start a new line. It is useful most of the time, but it also lands where you do not want it.

  • PDF files. A PDF stores each line of a page as its own piece of text. When you copy it, the line ends come along, and a paragraph turns into a ladder of short lines. This is the most common reason to fix text copied from a PDF.
  • Email. Plain-text email is commonly wrapped at about 78 characters (RFC 5322 recommends at most 78 and sets a hard limit of 998), and that wrapping can survive a copy and paste.
  • Chat. Pressing Enter in many chat boxes adds a break, so a long note can arrive as many short lines.
  • Code and logs. A log or a data export has one entry per line. If you need the entries in one row, the breaks have to go.

Choosing what replaces the break

A space suits ordinary writing. The lines become running text, and the words on each side of the old break stay apart.

Nothing glues the lines together. Use it for a long code or number that was wrapped, where a space would change the value.

A comma turns a list into one row, for example a column of names into "Anna,Ben,Chloe". For a comma followed by a space, pick Custom text and type both characters. Custom text can be up to 20 characters, so a semicolon or a pipe works too.

Keeping paragraphs

If your text has several paragraphs, joining everything pours them into one block. Tick Keep paragraph breaks to avoid that. The lines inside each paragraph are joined, and a blank line stays between paragraphs.

Remove empty lines is on by default. On its own it deletes blank lines before joining, so you get one block. Together with Keep paragraph breaks it is gentler: a run of blank lines becomes just one, and blank lines at the very start or end are dropped.

Cleaning up spaces

PDF text often has spaces at the end of each line, and those become double spaces when the lines are joined. Trim spaces at the start and end of each line is on by default for this reason. Collapse multiple spaces into one also shrinks any run of spaces or tabs inside a line. It is off by default, because some text, such as a table made with spaces, needs them.

Words split by a hyphen

Many PDFs split long words at the end of a line, so "international" arrives as "inter-" and "national". If you only join the lines, you get "inter- national". Switch on Fix words split by a hyphen at the end of a line to repair this. When a line ends with a hyphen after a letter and the next line starts with a lowercase letter, the two parts become one word and the hyphen is dropped.

It is off by default for a reason. A real hyphenated word that sits at the end of a line, such as "well-" followed by "known", would be joined into "wellknown" too. After using this option, skim the result.

Every kind of line ending

Windows ends a line with two characters, a carriage return and a line feed. Mac and Linux use one line feed, and older systems used a lone carriage return. Some text also contains Unicode line and paragraph separators. The tool handles all of them, even mixed in one text, so you do not need to know which you have. That also covers removing carriage returns that show up as odd symbols in some programs.

Size limit

You can paste up to 500,000 characters. If the text is longer, the tool does not process it and shows a message with the size of your text. Split the text at a paragraph break, clean each part, and join the results.

Tips

  • Try the default settings first. For most pasted text they are all you need.
  • For PDF text with several paragraphs, tick Keep paragraph breaks and add the hyphen option if you see split words.
  • After turning a list into one row, the remove duplicate lines tool can clear repeats first. This keyword list guide shows the idea.
  • The word counter measures the cleaned text, and this guide to shortening text helps if it must fit a limit. The case converter fixes capitals, as the article on changing case explains.
  • Keep the original. Nothing is stored, so refreshing the page clears your text.

Privacy

Your text is processed in your browser. It is not uploaded, saved or tracked, and there is no sign-up. Like every page on this site, this one may show ads from third-party vendors once ads are switched on, and those vendors can use cookies. Read the privacy policy for details.

Frequently asked questions

How do I remove line breaks from text?

Paste the text into the box. By default every line break becomes a space and empty lines are dropped, so the result is one line you can copy right away.

How can I keep my paragraphs?

Turn on Keep paragraph breaks. Lines inside a paragraph are joined, and a blank line stays between paragraphs. With Remove empty lines on too, extra blank lines are reduced to one.

Can I turn lines into a comma separated list?

Yes. Choose Comma to put a comma between the lines. If you want a comma and a space, choose Custom text and type them in. Tick Remove empty lines so no item is empty.

What does Fix words split by a hyphen do?

When a line ends with a hyphen after a letter and the next line starts with a lowercase letter, the two parts are joined into one word and the hyphen is dropped. It is off by default, because a real hyphenated word that ends a line would be joined too.

Is there a size limit?

Yes. The tool accepts up to 500,000 characters. If your text is longer, nothing is processed and a message asks you to split it into smaller parts. This keeps your browser fast.

Is my text uploaded anywhere?

No. The text is processed in your browser. Nothing is sent to a server or saved, so it is gone when you close or refresh the page.

Topics