To remove line breaks, paste your text into Raw Input, check that Remove line breaks is ticked (it is by default), choose what replaces each break under Line break replacement (a space by default), and select Clean text. The joined text appears in Cleaned Output, ready to copy or download. Everything runs in your browser.
How to remove line breaks from text
- Add your text. Paste it into Raw Input, drop a file on the upload area, or select Select text file to load a .txt, .csv, .log, .md or similar file.
- Check line break removal. Remove line breaks is ticked by default. Also tick Keep paragraph breaks to join the lines inside each paragraph but keep the blank line between paragraphs.
- Pick the replacement. Under Line break replacement, choose Replace with space for prose, Replace with comma + space or Replace with pipe | for lists, or Remove completely.
- Clean and save. Select Clean text (or press Ctrl+Enter). Use Copy output or Download for a .txt file, or Output → Input to run another pass.
Remove line breaks from PDF text
Text copied from a PDF usually has a hard line break at the end of every visual line, so a paragraph pastes as a stack of short lines. Remove line breaks with Replace with space joins them back into flowing sentences, and Collapse multiple spaces (on by default) removes the doubled spaces that joining can leave behind.
Two things to know. First, on its own the option joins every line, so separate paragraphs are merged into one block as well. Tick Keep paragraph breaks to join only the lines inside each paragraph and keep a blank line between paragraphs. Second, words that were hyphenated at the end of a line come out as exam- ple. Before joining, you can fix those in the find and replace tool with Regex mode on: find (\w)-\n(\w) and replace with $1$2. If you're starting from the PDF file itself, PDF to Text extracts the text first.
Every cleaning option, and its default
Options apply in a fixed order: tabs, trimming, empty lines, line breaks, spaces, special characters, duplicates, then case. Changing any option re-cleans the text right away.
| Option | Default | What it does |
|---|---|---|
| Remove line breaks | On | Joins all lines using the Line break replacement you choose |
| Keep paragraph breaks | Off | With Remove line breaks, joins lines inside each paragraph but keeps blank-line breaks between paragraphs |
| Remove empty lines | On | Deletes blank lines |
| Trim each line | On | Removes spaces at the start and end of each line, or of the whole text if Trim mode is set to Trim whole text only |
| Remove tabs | On | Turns tab characters into spaces |
| Collapse multiple spaces | On | Turns runs of spaces into one space |
| Remove special characters | Off | Keeps letters, numbers, spaces and anything in Allowed special characters |
| Remove duplicate lines | Off | Keeps the first copy of each line |
| Remove duplicate words | Off | Keeps the first copy of each word anywhere in the text |
| Case-sensitive duplicates | Off | Treats Word and word as different |
| Case conversion | No case change | lowercase, UPPERCASE, Sentence case or Title Case |
Remove special characters keeps letters from any language, including accented ones. Put the symbols you want to keep, such as .,@:/-, in Allowed special characters before cleaning an email list or URLs.
Remove duplicate lines and extra spaces
To dedupe a list of emails, keywords or product codes, put one item per line, tick Remove duplicate lines and untick Remove line breaks. Duplicates are matched ignoring case unless you tick Case-sensitive duplicates, and the first copy of each line is kept in its original position. The Cleaning Summary then tells you how many lines were removed.
Remove duplicate words works across the whole text, so in normal sentences it would delete every second the and and. It's meant for tag and keyword lists. A word with punctuation attached, such as apple,, counts as different from apple.
Extra spaces are handled by Collapse multiple spaces together with Trim each line, which between them fix double spaces after periods, indents and trailing spaces at line ends.
Turn a list into comma-separated text
Paste a column copied from Excel or Google Sheets, keep Remove line breaks ticked and choose Replace with comma + space. A column of names becomes Ana, Ben, Chloe, ready for an email field, a tag box or a SQL IN list. Choose Replace with pipe | when the items themselves contain commas. Remove empty lines (on by default) stops blank cells from turning into empty entries between commas.
Frequently asked questions
How do I remove line breaks but keep paragraphs?
Tick Keep paragraph breaks next to Remove line breaks. Lines inside each paragraph are joined with your Line break replacement, and paragraphs stay separated by one blank line.
Can I replace line breaks with commas?
Yes. Keep Remove line breaks ticked and set Line break replacement to Replace with comma + space. Each line becomes one item in a comma-separated list.
Does the text cleaner change my original text?
No. Your text stays in Raw Input and the result appears in Cleaned Output. Select Output → Input only when you want to clean the result again.
Why does Title Case capitalize small words?
Title Case here capitalizes the first letter of every word, including of, and and the. Letters after an apostrophe stay lowercase, so don't becomes Don't, and accented letters such as é are capitalized too. Fix those by hand if you follow a style guide such as AP or Chicago.
Is my text uploaded?
No. Cleaning happens in your browser with JavaScript, and files you load are read on your device. Nothing is sent to ToolzyLab.
Are there keyboard shortcuts?
Yes. In Raw Input, Ctrl+Enter (Cmd+Enter on a Mac) runs Clean text. The output also updates as you type and whenever you change an option.