How to remove line breaks
- Paste your text into the box above.
- Keep the default Keep paragraphs mode for most text.
- Pick Remove every break if you need one single line.
- Leave the tidy option on to fix double spaces.
- Copy the clean text or download it.
What this tool gives you
- Keep paragraphs mode that joins lines but keeps blank line breaks.
- Remove every break mode for CSV cells and one line fields.
- Remove blank lines only mode that closes gaps but keeps each line.
- Automatic cleanup of the double spaces that joins create.
- A fix for stray spaces before commas and periods.
- A count of line breaks removed.
Where broken text comes from
Copy a paragraph out of a PDF and paste it somewhere else. You often get something that looks like a poem. Every line ends after eight or nine words. The breaks fall in the middle of sentences for no reason.
Plain text emails and terminal output cause the same mess. So does anything set to a fixed width. These formats store text as it looks on a page and not as it flows.
A PDF has no idea what a paragraph is. It holds letters at fixed spots. A line ends because the layout ran out of width. Older email apps also wrapped text at 72 or 78 characters.
Paste that text into a word processor and you get two sets of breaks fighting each other.
Why the default mode works best
A tool that removes every break destroys your structure along with the problem. Paragraphs merge into one huge block. Headings run into the text below them. Lists turn into sentences.
Keep paragraphs mode tells the two kinds of break apart.
- A single line break inside a block is a wrap. The tool joins it.
- A blank line is a real paragraph break. The tool keeps it.
Almost every writing app marks paragraphs this way. So this method handles nearly all pasted text correctly.
Three ways to remove line breaks
| Mode | Result | Use it for |
|---|---|---|
| Keep paragraphs | Flowing paragraphs | PDF text, emails and articles |
| Remove every break | One long line | CSV cells, JSON strings and one line fields |
| Remove blank lines only | Lines stay separate with no gaps | Lists and code |
Remove line breaks and tidy spacing in one pass
A join can leave two spaces where one line ended with a space and the next began with one. Text from PDFs also often carries a stray space before a comma or period. The extractor read them as separate pieces.
The tidy option fixes both. It shrinks runs of spaces to one. It pulls punctuation back next to the word before it. The result looks like properly typeset text. Turn it off only when spacing carries meaning, such as aligned code or text tables.
What line break removal cannot fix
Some text loses information that no tool can recover. A word split with a hyphen across two lines comes through as two pieces. The join gives you something like hyphen- ated. No tool can reliably tell that apart from a real hyphenated word. So fix those by hand. A quick search for a hyphen followed by a space finds most of them.
A quick before and after example
Text copied from a PDF often looks like this:
The quick brown fox jumps overthe lazy dog and runs into theforest before night falls.
After the tool it reads as one clean sentence. The quick brown fox jumps over the lazy dog and runs into the forest before night falls.
Common line break problems and fixes
My headings joined the paragraph below
The source had no blank line after each heading. Add a blank line after headings and run the tool again.
My list turned into one sentence
Use Remove blank lines only for lists. That mode keeps each line separate.
Who removes line breaks?
Students paste quotes from PDF papers into essays. Writers move old email drafts into a document. Data teams squeeze text into a single CSV cell. Developers clean terminal output for a bug report. Translators fix choppy source text before they work on it.
Tips for clean text every time
- Extract PDF text with PDF to text and turn off line breaks there first.
- Run the text cleaner after this tool to strip odd characters.
- Use the whitespace remover for tabs and extra spaces.
- Check your word total with the word counter.
Your text stays private
The tool works inside your browser. Extracted documents and drafts never leave your device. It sends nothing to a server.