Remove Line Breaks From Text
Remove line breaks turns text spread across many lines into a single clean line. It helps when you copy from a PDF, email or code comment and the wrapping comes along for the ride. Choose what replaces each break, collapse repeated spaces, and copy the flattened result.
How to remove line breaks
- Paste or type your text into the top box.
- Open the 'Replace breaks with' menu and pick Space, Nothing, or Comma and space.
- Leave 'Collapse extra spaces' on to squeeze repeated spaces and tabs into one.
- Leave 'Trim ends' on to drop leading and trailing whitespace.
- Read the single-line result below and click Copy.
Examples
Flatten an email to one line (replace with a space)
Dear team, Thanks for the update. Best, Ada
Dear team, Thanks for the update. Best, Ada
Rejoin a hard-wrapped word (replace with nothing)
one two three
onetwothree
Turn a stacked list into a sentence (comma and space)
apple banana cherry
apple, banana, cherry
Frequently asked questions
What can I replace each line break with?
Three choices: a single space (the default), nothing at all, or a comma followed by a space. A space keeps words readable, nothing is useful for rejoining a split word or token, and comma plus space builds a quick inline list.
Does this also remove extra spaces?
Yes, when 'Collapse extra spaces' is on. Runs of two or more spaces or tabs are reduced to a single space, so joined lines do not leave gaps behind. Turn it off if the exact spacing matters.
Will it clean up text copied from a PDF?
Yes. PDFs often insert a break at the end of every visible line, which chops a paragraph into fragments. Replacing breaks with a space and collapsing spaces stitches the paragraph back into flowing text.
Does it remove blank lines and paragraph breaks too?
Yes. Every line break is replaced, including the empty lines between paragraphs. With space collapsing on, a blank line does not leave a double space, so paragraphs merge cleanly into one line.
Are Windows, Mac and Unix line endings supported?
Yes. Windows CRLF, classic Mac CR and Unix LF endings are all detected and replaced, so it does not matter which operating system produced the text.
What does the 'Trim ends' option do?
It removes any whitespace at the very start and end of the result, so you do not get a stray leading space from a break that sat at the beginning of the text.
Does it change my punctuation or capitalization?
No. Only whitespace is touched. Letters, numbers, punctuation and casing are left exactly as you pasted them.
Is there a length limit?
There is no fixed limit. The work happens in your browser, so the practical ceiling is your device memory. Very large pastes update almost instantly.
Is my text private?
Yes. Everything runs locally in your browser and nothing is uploaded to a server, so sensitive text never leaves your device.
Learn more
- CR, LF and CRLF line endings explained
What carriage return and line feed really are, why Windows, Mac and Unix disagree, and how to normalize the breaks in any text.
Related tools
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
JSON to CSV
Convert JSON to CSV online. Paste an array of objects and get clean, spreadsheet-ready CSV with the right headers. Runs in your browser.
Sort Words Alphabetically
Sort words or a list into alphabetical order online. Choose A to Z or Z to A, ignore case, remove duplicates, and split by space, line or comma.
Acronym Generator
Turn any phrase into an acronym from the first letter of each main word. Skip small words like the and of, keep them, or add dot separators.
Add Line Numbers
Add line numbers to any text online. Set the start value, step, and separator, pad numbers to align, and copy or download the result. Free and private.
AI Sentiment Analyzer
Analyze the sentiment of any text with AI in your browser. Paste a review or comment, get a positive or negative score plus a per-sentence breakdown.