Remove Line Breaks
A line break remover joins the lines of your text into one continuous block by replacing each line break with a space, a comma or nothing. Paste your text, choose what goes in place of the breaks, and copy the result. It can keep paragraphs and repair words split by a hyphen at the end of a line.
How to use the remove line breaks
- Paste your text into the top box. The result appears underneath as you type or paste.
- Choose what should replace each line break. A space is right for ordinary text, a comma turns a list into one line, and Nothing joins the lines with no gap.
- Tick Keep paragraphs if the text has blank lines between paragraphs that you want to stay. Tick the hyphen option if the text came from a PDF or a printed column.
- Press Copy result to take the text away, or Download .txt to save it.
How line breaks are removed
The tool splits your text into lines, tidies each line and joins them again with the replacement you chose. It follows these steps in order.
- Find the breaks. A line break is any of the characters that end a line: the line feed and carriage return used by Windows, Mac and Linux, plus the less common vertical tab, form feed, next-line and Unicode line and paragraph separators.
- Tidy each line. Spaces at the start and end of every line are removed, and lines that are empty are dropped, so blank lines do not turn into double spaces.
- Join the lines. The remaining lines are joined with a space, a comma and a space, nothing, or your own text. With Keep paragraphs on, a blank line (or several) is treated as the end of a paragraph, the lines inside each paragraph are joined, and paragraphs stay apart with one empty line between them.
- Repair split words (optional). If 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 with no gap, so “mem-” and “ory” become “memory”.
- Collapse spaces (optional). Runs of spaces and tabs inside the text are reduced to a single space.
The hyphen option cannot tell a word split by a printer from a real hyphenated word. “Well-” at the end of a line followed by “known” becomes “wellknown”, so read the result if your text contains many compound words.
Worked example
Text copied from a PDF often has a break at the end of every printed line and a split word. Here is the input, with ↵ marking each line break:
The study found that sleep affects mem-↵ ory more than expected. Participants↵ who slept eight hours scored higher.↵ ↵ A second group slept less and↵ scored lower.
With the default settings (a space, no paragraphs, no hyphen repair), everything becomes one line and the split word stays split:
The study found that sleep affects mem- ory more than expected. Participants who slept eight hours scored higher. A second group slept less and scored lower.
With Keep paragraphs and the hyphen option on, the word is repaired and the blank line is kept:
The study found that sleep affects memory more than expected. Participants who slept eight hours scored higher.↵ ↵ A second group slept less and scored lower.
Choosing A comma and a space turns a list of three lines (apples, bananas, cherries) into apples, bananas, cherries.
The options at a glance
| Option | What it does | Typical use |
|---|---|---|
| A space | Puts one space where each break was | Text copied from a PDF, email or web page |
| Nothing | Joins lines with no gap | Codes, numbers or a long string split over lines |
| A comma and a space | Turns a list into a comma-separated line | Lists of names, tags or keywords |
| Custom text | Puts your own text between the lines | A pipe, a semicolon or a tab-like separator |
| Keep paragraphs | Joins lines inside a paragraph, keeps blank-line gaps | Long documents with several paragraphs |
| Join split words | Removes a hyphen at the end of a line when the next line continues the word | PDFs and scanned text |
| Collapse repeated spaces | Reduces runs of spaces and tabs to one space | Text with uneven spacing |
Frequently asked questions
Why does text copied from a PDF have line breaks in the middle of sentences?
A PDF stores text as lines positioned on a page, not as flowing paragraphs. When you copy it, each printed line usually arrives with a break at its end. Removing the breaks makes the text flow again.
What is the difference between a line break and a paragraph break?
A line break ends a line, and a paragraph break is usually two line breaks in a row, which leaves a blank line. Turn on Keep paragraphs to remove the first kind and keep the second.
Why are some words stuck together in my result?
You probably chose Nothing as the replacement. With no space between the lines, the last word of one line and the first word of the next run together. Choose A space for normal text.
Does it remove spaces or other characters?
It removes spaces at the start and end of each line, drops empty lines and, if ticked, reduces repeated spaces to one. It never changes letters, numbers or punctuation, apart from the hyphen at the end of a line when you ask for split words to be joined.
Can I get my line breaks back?
Your original text stays in the top box and is never changed, so you can adjust the options or paste it again. Once you copy the result somewhere else, the breaks in that copy are gone.
Is my text uploaded or stored?
No. The line breaks are removed in your browser and your text never leaves your device.
Related tools
- Remove Extra SpacesCollapse double spaces, trim lines and fix tabs and no-break spaces.
- Remove Empty LinesDelete blank lines, or keep just one between paragraphs.
- Duplicate Line RemoverDelete repeated lines and keep one copy, or keep only the unique ones.
- Word CounterLive word, character, sentence and paragraph counts, reading time and keyword density.
- Case ConverterSwitch text between upper, lower, title, sentence, camelCase, snake_case and more.
- Diff CheckerCompare two texts and see added, removed and changed lines and words.
Sources and references
- Unicode Standard Annex #14: Line Breaking Algorithm — the characters Unicode treats as line and paragraph breaks
- MDN Web Docs: Regular expression character classes — how line terminators are matched in JavaScript