Skip to content
CleanGlyph home

Remove Line Breaks Online

Remove unwanted line breaks from copied text, join wrapped lines into paragraphs, or combine everything into one line. Free, instant and private.

Your text never leaves your browser.

0 lines · 0 characters · 0 line breaksAnalyzed as you type

Joined text

Paste text to remove unwanted line breaks.

Line break options

ModeMode

Single line breaks become spaces. An empty line, or one containing only spaces or tabs, marks a paragraph break and is kept.

Cleanup

Remove extra spaces and tabs at joined line boundaries so words are separated cleanly.

Remove spaces, tabs and blank lines only from the beginning and end of the final result.

Remove a hyphen before a wrapped line break when a word continues on the next line. Review the result because some hyphens are intentional.

Need to fix other spacing or hidden characters? Use the Text Cleaner.

How to remove line breaks from copied text

Paste the text into the input box and copy the result. Nothing has to be submitted: the output updates as you type or change an option. By default, line breaks inside a paragraph are replaced with a single space and paragraphs separated by an empty line stay separate.

Copied from a PDF
This paragraph was copied
from a PDF document and
contains unwanted line breaks.
Preserve paragraphs (default)
This paragraph was copied from a PDF document and contains unwanted line breaks.

Choose how lines are joined

  • Preserve paragraphs

    The default. Single line breaks become spaces; empty lines between paragraphs are kept as one empty line.

  • Join with spaces

    All text goes on one line, with one space where each line break was.

  • Join without spaces

    Line breaks are deleted and nothing is inserted. Good for split codes and values.

How paragraphs are detected

Preserve paragraphs uses one simple rule: an empty line, or a line containing only spaces or tabs, is a paragraph break. Every other line break is joined. The tool does not guess where sentences end and it does not understand headings, lists, code, tables or poetry, where a single line break is often intentional. If every line of your text matters, do not run it through this tool, or add an empty line wherever a break must stay. A line that contains a non-breaking space or a zero width space is treated as text, not as an empty line.

Fix words split by hyphens

PDFs and e-books often break long words at the end of a line, leaving inter- on one line and national on the next. Turn on Join words split by hyphens to remove that hyphen when a letter comes before it and a letter starts the next line. It only touches an ordinary hyphen at a line break that is being joined. Hyphens inside a line, en and em dashes, soft hyphens and hyphens before a paragraph break are never removed. The option cannot tell a broken word from a real compound such as well- known split across two lines, so it is off by default and you should review the result.

Option off
This is an inter- national document.
Option on
This is an international document.

Windows, Mac and Unix line endings

Text files end lines with different characters: CRLF on Windows, LF on Linux and macOS, and CR on very old Mac systems. All three are recognized, even when mixed, and a CRLF pair always counts as one line break. Paragraph breaks that are kept are written as LF. The Unicode line separator U+2028 and paragraph separator U+2029 are left unchanged. To normalize line endings or remove hidden characters without joining lines, use the Text Cleaner or the Invisible Character Detector.

Spaces around joined lines

Copied lines often end with trailing spaces or begin with indentation. With Clean spaces around joined lines on, the spaces and tabs at each joined boundary are removed so exactly one space separates the words. Spacing inside a line, non-breaking spaces and the indentation of the first line in a paragraph are never changed. Turn the option off to keep existing spaces and tabs; a joining space is then added only where the boundary has none. Trim outer whitespace separately removes spaces, tabs and empty lines from the very start and end of the result. To check exactly what changed, compare the input and output in the Text Difference Checker. To see how many words, characters and lines remain, use the Word & Character Counter.

Frequently asked questions

How do I remove line breaks from text?

Paste your text into the input box. The result updates as you type, with single line breaks inside paragraphs replaced by spaces. Copy the result or choose Join with spaces to put everything on one line.

How do I remove line breaks but keep paragraphs?

Use Preserve paragraphs, the default mode. Lines are joined with a space, and an empty line, or a line containing only spaces or tabs, is treated as a paragraph break. Several empty lines in a row become one empty line.

Why does text copied from a PDF have line breaks?

PDFs store text positioned on a page rather than as flowing paragraphs. When you copy it, each visual line usually ends with a real line break, so a paragraph turns into many short lines.

Why did two of my paragraphs merge?

Preserve paragraphs only recognizes a paragraph break when there is an empty line between paragraphs. If your source separates paragraphs with a single line break, the tool cannot tell them apart from wrapped lines. Add an empty line between paragraphs first, or join them manually.

Can I fix words split with a hyphen?

Yes. Turn on Join words split by hyphens to remove an ASCII hyphen that sits between two letters at a wrapped line break, so inter- followed by national becomes international. Review the result, because some compound words such as self- and well- are meant to keep their hyphen.

What is the difference between Join with spaces and Join without spaces?

Join with spaces puts all text on one line and puts a single space where each line break was. Join without spaces removes the breaks and adds nothing, which is useful for split identifiers, codes, hashes and data values.

Does it work with Windows line endings?

Yes. Windows CRLF, Unix LF and classic Mac CR line endings are all recognized, even when mixed in the same text. A CRLF pair counts as one line break. Paragraph breaks in the result are written as LF.

Is my text uploaded?

No. Everything runs in your browser on your device. Your text is never sent to a server, saved or logged by CleanGlyph.