Remove line breaks from text
Paste text with hard line breaks and turn it into one clean line, or keep the paragraphs and drop every other break.
Choose “Keep paragraphs” to keep the blank lines between paragraphs. For text copied from a PDF, turn on rejoining hyphenated words too. It all runs in your browser: your text is never uploaded.
Example input and result
Text copied from a PDF keeps the line breaks of the original page. Each line ends where the column ended, and long words get split with a hyphen, like this exam- ple, so the text is hard to reuse.
Result
Text copied from a PDF keeps the line breaks of the original page. Each line ends where the column ended, and long words get split with a hyphen, like this exam- ple, so the text is hard to reuse.
How to remove line breaks from text
Paste your text and each line break is replaced by a space, so words don't run together. That's the default mode, and it fits most jobs: a paragraph copied from a PDF, an email with hard wraps, or the output of a scanner's OCR. The tool shows how many line breaks it removed, and “Copy result” and “Download TXT” save the result.
“Collapse extra spaces” is on by default, so the double spaces you often get after joining lines shrink to one. The tool handles Windows (CRLF) and Mac or Linux line endings alike, so text from any system gives the same result. Everything runs in your browser, nothing is uploaded, and the box takes up to 500,000 characters.
Remove line breaks four ways
Pick a mode to choose what each line break turns into:
- Replace line breaks with spaces: the default, which turns the whole text into one line
- Keep paragraphs: single line breaks go, but the blank lines between paragraphs stay, so a long text keeps its shape
- Remove them completely: lines join with nothing between them, handy for a link or a code string split across lines
- Replace with commas: each line break becomes a comma, which turns a column of items into one line
Rejoin words hyphenated across lines
PDFs and scanned pages often split long words at the end of a line with a hyphen, like “exam-” on one line and “ple” on the next. Removing the line break alone leaves “exam- ple” in the middle of your sentence. Turn on “Rejoin words hyphenated across lines” and the tool joins those halves back into “example”.
The option joins any word that ends in a hyphen at the end of a line, so a real compound split at its own hyphen, like “well-” and “known”, comes out as “wellknown”. Look for compounds like that in the result and put their hyphen back by hand.
Text to one line for spreadsheets and code
A single line is what you need to paste text into one spreadsheet cell, a form field that keeps only the first line, or a string in code. Replace line breaks with spaces, check the result, and copy it. For a list of values on separate lines, “Replace with commas” gives you one line you can drop into a formula or a query.
“Keep paragraphs” is the mode for a multi-page article from a PDF. “Remove them completely” glues the last word of one line to the first word of the next, so use it only when lines were split in the middle of a word or a string. For a list with its own delimiter, quotes, or spacing, the comma separated list tool gives you more control.
Frequently asked questions
How do I remove line breaks from text copied from a PDF?
Paste the text, keep “Replace line breaks with spaces” or choose “Keep paragraphs” for a longer piece, and turn on “Rejoin words hyphenated across lines” so split words come back whole. Then copy the result. The counter shows how many line breaks were removed.
How do I keep paragraphs but remove the other line breaks?
Choose “Keep paragraphs”. Single line breaks inside a paragraph go away, and the blank lines between paragraphs stay, so the text keeps its structure. If your paragraphs aren't separated by a blank line, the tool can't tell where one ends, and they join into one.
Why are some words stuck together?
You're probably using “Remove them completely”, which joins lines with nothing in between. That mode is meant for links or code split across lines. For normal text, switch to “Replace line breaks with spaces”, which puts a space where each break was.
Does it work with Windows line breaks?
Yes. Windows ends each line with two characters, a carriage return and a line feed (CRLF), while Mac and Linux use only the line feed. The tool handles both, so text from Word, Notepad, or a Mac app comes out equally clean.
What does Collapse extra spaces do?
It turns runs of several spaces into a single space. Joining lines often leaves double spaces, for example when a line already ended with a space, and this option cleans them up. It's on by default. Turn it off if your text needs repeated spaces, like aligned columns.