Remove Line Breaks
Remove line breaks
Remove extra spaces, empty or duplicate lines and line breaks; sort lines; find and replace.
Free, private, no sign-up
Was this tool helpful?
Suggest an improvementWhat the Text Cleaner can do
Paste any text or list, then pick a quick fix or tick the options you need. The steps always run in the same order, so the result is predictable:
- Find and replace
- Trim spaces at the start and end of each line
- Collapse repeated spaces and tabs into one space
- Remove empty lines
- Remove duplicate lines (the first one is kept)
- Sort lines (A to Z, Z to A, by number or by length)
- Reverse the line order
- Remove line breaks, joining everything into one line
Good to know
How do I remove duplicate lines but ignore upper and lower case?
Tick Remove duplicate lines, then Ignore case when finding duplicates. "Apple" and "apple" will then count as the same line.
How do I fix text copied from a PDF?
Use Remove line breaks. It joins the broken lines into one paragraph and tidies the spaces.
Can I use regular expressions?
Yes. Tick Use a regular expression to use a JavaScript regex in Find, and $1, $2 in Replace with to reuse captured groups. If the pattern isn't valid, you'll see why.
How does sorting handle numbers?
A to Z sorting is natural, so "item 2" comes before "item 10". Numbers, smallest first sorts by the first number on each line.
Is my text private?
Yes. Everything runs in your browser. Your text is never uploaded or saved.