Remove Line Breaks — Join Lines Online
Join lines and clean up spacing, with an option to keep paragraphs
Runs in your browser · nothing is uploaded
Result updated (0 characters)
What it is
This tool turns text that is split over many lines into a single line or a single paragraph. Text copied from PDFs, emails, chat apps and terminals often carries a hard line break at every wrap point. That is fine on screen but awkward when you paste it into a document, a translator, a spreadsheet cell or a search box. You can pick how breaks are removed, and tidy leftover spacing in the same step.
How to use
- Paste your text into the input box.
- Pick a mode: Remove all, Replace with a space, or Keep paragraphs.
- Optionally trim the start and end of every line, and collapse repeated spaces into one.
- In Keep paragraphs mode, turn on the join-without-space option if lines were split in the middle of words.
- Copy the result. The counter above it shows how many lines went in and came out.
How it works
- Line breaks: CRLF, CR, LF, U+2028 and U+2029 each count as one break. A single trailing break at the end of the input is not counted as an extra line.
- Remove all: blank lines are dropped and the remaining lines are concatenated with nothing between them. Paragraph breaks disappear too.
- Replace with a space: blank lines are dropped and one space joins the remaining lines, so a blank line never produces a double space.
- Keep paragraphs: a blank line, including one that holds only spaces or tabs, separates paragraphs. Lines inside a paragraph are joined, and paragraphs are separated by exactly one blank line. Leading and trailing blank lines are removed.
- Collapse spaces: runs of two or more spaces, tabs or ideographic spaces (U+3000) become one space. Single spaces are untouched.
- Trim lines: spaces at both ends of every line are removed before the lines are joined.
Examples
| Input | Mode | Result |
|---|---|---|
| one, two, three on separate lines | Replace with a space | one two three |
| inter, national on two lines | Remove all | international |
| Two lines, a blank line, then two more | Keep paragraphs | Each pair joined, blank line kept |
| a, three spaces, b | Collapse spaces | a b |
FAQ
How do I fix text copied from a PDF with a line break at the end of every line?
Choose Keep paragraphs. Blank lines are treated as paragraph boundaries and stay, while the single line breaks inside each paragraph become spaces. If a word was split across two lines without a hyphen, also turn on the option that joins lines without a space.
What is the difference between Remove all and Replace with a space?
Replace with a space puts one space where each break was, so words never run together. Remove all inserts nothing, which suits text where lines were cut in the middle of words or where you want a list squeezed into one continuous string.
Does it handle Windows (CRLF) and old Mac (CR) line endings?
Yes. CRLF, CR, LF and the Unicode line and paragraph separators (U+2028 and U+2029) all count as one line break. In Keep paragraphs mode, input that used CRLF is written back with CRLF between paragraphs.
Is my text sent anywhere?
No. The text is processed by JavaScript in this page and never leaves your browser.
Related tools
Character Counter
A character and word counter with bytes and platform length presets
Remove Duplicate Lines
Delete repeated lines and keep the first of each, in order
Sort Lines
Sort or shuffle lines with natural number ordering
Lorem Ipsum Generator
Classic Lorem Ipsum by paragraphs, sentences or words, with optional HTML tags