About Remove Line Breaks
This tool removes the line breaks from your text and joins the lines with a single space. Paste text that was broken into short lines, such as copy from a PDF or an email, and the Result shows it as one flowing line. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.
Every run of line breaks, with any spaces around it, becomes one space, and the ends of the text are trimmed, so blank lines do not leave double spaces. That also joins separate paragraphs into one line, so if you want to keep paragraphs apart, remove the breaks only in the part where they are wrong.
If a hyphenated word was split across two lines, it is joined with a space, so check words that were broken at the end of a line. You can also add a Find and Replace rule alongside, for example to replace a space-and-hyphen pair.
How to use Remove Line Breaks
- Paste your text into the Text box.
- Type the text to look for in Find and its replacement in Replace with. The Result below shows the new text and says how many replacements were made.
- Tick Case sensitive, Whole word, or Regex as needed. Untick Replace all to change only the first match.
- Press Add rule to run several replacements in order. Each rule works on the output of the one before it.
- Tick Remove line breaks, Remove extra spaces or Remove duplicate lines for a cleanup. Then Copy, Download .txt, or Move to input to work on the result.
Features
- Plain text or regular expression (JavaScript syntax) rules.
- Case sensitive and Whole word options, and Replace all or first match only.
- Regex options for multiline (^ and $ match at each line) and dot matches newline.
- Capture groups in the replacement: $1, $2, $&, $$ and named $<name>.
- Several rules in one pass, applied in order, with a replacement count for each.
- Cleanups for line breaks, extra spaces and duplicate lines.
- A clear message when a regular expression is invalid, instead of a crash.
- Move to input, Undo, Copy and Download .txt.
Worked examples
line one line two line three gives line one line two line three
Windows and Unix line breaks are both handled, and the spaces around each break are removed.
Privacy: how it works
- The replacing runs in your browser tab. Your text is not sent to Ulkaa or to any other server.
- This tool does not save your text. Close or reload the page and it is gone.
Tips
- Turn on Whole word when you replace short words, or "cat" will also change "category".
- Test a regex on a small piece of text before you run it on a long one. The count tells you whether it matched what you expected.
- Use Move to input to continue from the result, and Undo if a step went wrong.
- Keep a copy of the original text. This tool does not save it for you.
Frequently asked questions
Is it really free?
Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.
Do I need an account?
No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.
Does it run in my browser?
Yes. Your text are processed by code running in your browser tab, on your own device.
Is my data uploaded?
No. Your text are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.
How do I remove line breaks from text?
Paste the text. This page has Remove line breaks ticked already, so the Result shows one line. Copy it from there.
Does it remove blank lines too?
Yes. A blank line is just another line break, so it is removed along with the rest, and only a single space is left between the words.
Can I keep paragraphs?
Not with this cleanup, because it removes all breaks. Use a Regex rule on the lines you want to join, or process the paragraphs separately.
More Find and Replace Text pages
- Find and Replace TextPaste your text, set one or more rules and see the replaced result with a count.
- Find and ReplaceReplace every copy of a word or phrase in your text at once.
- Regex ReplaceReplace text by pattern, with capture groups, in your browser.
- Remove Extra SpacesCollapse double spaces and trim every line.
- Remove Duplicate LinesKeep the first copy of each line and drop the repeats.
- Replace Multiple Words at OnceRun several find and replace rules on your text in one go.