How to remove line breaks from text
- Paste your text into the box above. Text from a PDF, an email or a website all work.
- Choose what to remove. "Remove all line breaks" turns everything into one block. "Keep paragraphs" joins the broken lines but keeps the blank line between paragraphs.
- Choose what goes in their place: a space, nothing, a comma, or your own separator.
- Copy the result. It updates as you type, so you can change the options and see the difference straight away.
Remove all line breaks or keep paragraphs?
Use Remove all line breaks when the text needs to go into a single-line field, such as a form, a spreadsheet cell or a meta description, or when you are turning a list into one line.
Use Keep paragraphs for anything people will read. It fixes the lines that were cut in the middle of a sentence but leaves each paragraph as its own block, so the text still has its shape.
Why pasted text has line breaks in the wrong places
Most of the time the line breaks were never part of the writing. They came from the place you copied it from:
- PDFs. A PDF stores text line by line, the way it is laid out on the page. When you copy it, each line usually comes with its own line break, so a paragraph turns into a column of short lines.
- Plain-text emails. The email standard (RFC 5322) says a line should be no more than 78 characters long, so many email programs wrap plain-text messages at around that width. Copy one and you get a break every few words.
- Code editors and notes apps. Some wrap lines with real line breaks instead of just wrapping them on screen.
Words split across two lines with a hyphen are common in PDFs too, like "exam-" on one line and "ple" on the next. Tick Join words split with a hyphen and the tool puts them back together. It only joins them when the next line starts with a small letter, but check the result, because a real hyphenated word that happens to fall at the end of a line, like "well-known", will be joined too.
What to replace line breaks with
| Option | Use it for |
|---|---|
| Space | Normal text. Lines are joined with a single space, so words do not run together. |
| Nothing | Text that was split in the middle of a word or a long code, such as a link or an ID broken across lines. |
| Comma | Turning a list into one line, such as keywords or tags. YouTube, for example, asks for tags separated by commas. |
| Custom | Anything else: a slash, a pipe, a semicolon, or several characters. |
Remove extra spaces is on by default. It turns runs of two or more spaces into one, which tidies up text copied from PDFs and tables.
Need the opposite?
If your problem is that line breaks keep disappearing, for example in an Instagram caption, use the Instagram line break generator. It keeps your empty lines in place when you post.
Once your text is cleaned up, you can check its length with the word and character counter or change its capitals with the text case converter.
Windows, Mac and Linux line breaks
Line breaks are not the same everywhere. Windows marks the end of a line with two characters (a carriage return and a line feed), while Mac and Linux use a single line feed. Text that moves between them can end up with odd spacing or doubled breaks. This tool handles both kinds, so it does not matter where your text came from.
Frequently asked questions
How do I remove line breaks from text copied from a PDF?
Paste it into the box above and choose "Keep paragraphs". The broken lines are joined back into sentences, and the gaps between paragraphs stay. Tick "Join words split with a hyphen" if words were split across lines.
How do I turn a list into one line separated by commas?
Paste the list with one item per line, choose "Remove all line breaks" and pick "Comma". Each line becomes one item in a comma-separated list.
Will removing line breaks join words together?
Not with the default "Space" option, which puts a space where each line break was. Only "Nothing" joins the lines directly, which is meant for things like links or codes split across lines.
Does it keep my paragraphs?
Yes, if you choose "Keep paragraphs". Single line breaks inside a paragraph are removed, and blank lines between paragraphs are kept.
Is my text stored anywhere?
No. Everything runs in your browser. Nothing you paste is sent or saved.