ToolBrainy

Remove Line Breaks

Clean up messy text, join broken lines into one paragraph, strip empty lines or collapse extra blank lines, instantly in your browser.

Mode

About this tool

When you copy text from a PDF, a scanned document, an old email, or a terminal output, the lines often break at fixed widths — mid-sentence, mid-word sometimes. Pasting that into a Google Doc, a CMS, or a chat window leaves a wall of choppy, unreadable text. This tool fixes that.

There are three cleaning modes. Join into one line removes every line break so the whole passage becomes a single continuous paragraph — ideal for PDF text or wrapped email quotes. Remove empty lines keeps your real line breaks but deletes any blank lines in between — useful for cleaning up spaced-out lists. Collapse blank lines reduces multiple consecutive blank lines to just one, preserving paragraph structure while removing excess spacing. A "Trim spaces" checkbox also strips leading and trailing spaces from every line before joining. All processing happens locally in your browser — nothing is sent to a server.

How to use

1
Paste your broken text

Copy and paste the text with unwanted line breaks — from a PDF, an email, a document, or anywhere else. The result updates as you type.

2
Choose a mode

Select "Join into one line" to flatten everything, "Remove empty lines" to keep real breaks but delete blank lines, or "Collapse blank lines" to preserve paragraphs while reducing excess spacing.

3
Copy or download

Hit "Copy result" to put the cleaned text on your clipboard, or "Download .txt" to save it as a file. Then paste it wherever you need it.

Why use it

Private by design

Your text never leaves your browser, nothing is uploaded.

Three cleaning modes

Join lines, remove empty lines or collapse blanks.

Real-time

The cleaned result updates the moment you edit.

100% free

No signup, no limits and no watermarks, ever.

Common sources of broken line breaks

PDF copy-paste

PDFs store text in fixed-width columns. When you copy and paste, the line endings come with the text. Use "Join into one line" to turn that into a clean paragraph, then paste into your editor.

Forwarded emails

Email clients that hard-wrap lines at 72 or 80 characters leave breaks mid-sentence when you forward or copy the message. Join mode removes all of them so you get clean prose.

Code and terminal output

Log files and terminal output often have hard line breaks that aren't meaningful. Join them into one line to make searching or importing into a spreadsheet easier.

AI-generated text

Some AI tools output text with excessive blank lines between each sentence. Use "Collapse blank lines" or "Remove empty lines" to normalise the spacing before using it in a document.

SRT subtitles and captions

Subtitle files break dialogue across multiple lines. Copy the text content from an SRT file, join the lines, and get a clean transcript you can paste into a document or CMS.

Spreadsheet exports

Cell content from Excel or Google Sheets sometimes contains newline characters that cause problems when imported into other systems. Clean them out before processing the data.

Examples

Say you copied this from a PDF: The report covers three\nregions and was\nfiled in March. With "Join into one line" and Trim spaces on, you get The report covers three regions and was filed in March. — one clean sentence, no stray breaks.

Pasting text with double spacing between every line, like First point.\n\n\nSecond point.\n\n\nThird point., and choosing "Collapse blank lines" leaves a single blank line between each: First point.\n\nSecond point.\n\nThird point. The structure stays, the clutter goes.

A list with blank rows mixed in — Apples\n\nBananas\n\nCherries — run through "Remove empty lines" becomes a tidy three-line list: Apples\nBananas\nCherries, ready to drop into a spreadsheet column.

Common mistakes to avoid

Using "Join" when you meant "Collapse"

"Join into one line" flattens everything into a single block. If you wanted to keep paragraph breaks, that's too aggressive — reach for "Collapse blank lines" instead so your structure survives.

Forgetting to trim spaces

Joining lines without trimming leaves indent spaces stuck in the middle of sentences, so words end up with two or three spaces between them. Turn on Trim spaces to avoid that.

Expecting it to guess paragraph boundaries

The tool can't reliably tell a mid-sentence break from a real paragraph break in raw text. If you join everything, plan to re-add paragraph breaks yourself in the target editor.

Not checking the result before pasting

Different sources hide different characters — non-breaking spaces, tabs, carriage returns. Glance at the cleaned output first so you don't carry a surprise into your document.

Best practices

Match the mode to the source

PDF or email wrap? Use Join. AI text with big gaps? Collapse blank lines. A list with empty rows? Remove empty lines. Picking the right mode saves you from re-editing.

Keep Trim spaces on for pasted text

Most copy-paste sources carry leading or trailing spaces you can't see. Leaving Trim spaces enabled by default keeps your output clean without extra checking.

Clean before you count or format

If you're going to word-count, convert case, or import the text next, remove the broken breaks first. Downstream tools behave better with clean input.

Work on a copy for important data

When cleaning spreadsheet exports or data you can't easily regenerate, keep the original file. That way a wrong mode choice is a quick undo, not lost work.

Frequently asked questions

Is this tool free?

Yes, completely free. No account, no character limit, no watermarks. Paste as much text as you need.

What's the difference between the three modes?

"Join into one line" removes every line break and produces one solid block of text. "Remove empty lines" keeps your real line breaks but deletes any lines that contain only whitespace. "Collapse blank lines" leaves up to one blank line between paragraphs — removing extras — which preserves structure while reducing clutter.

I want to keep my paragraph breaks but remove the ones inside paragraphs. How?

This is the most common PDF copy-paste problem. Unfortunately, removing mid-paragraph line breaks while keeping paragraph breaks requires the tool to distinguish between them — which it can't always do reliably for arbitrary text. The best approach: use "Join into one line" to remove everything, then manually re-add paragraph breaks where needed in your target editor.

What does the "Trim spaces" checkbox do?

When enabled, it strips leading and trailing whitespace from each line before joining. This prevents extra spaces appearing at the start of sentences — a common side effect when copying from PDFs that had indented lines.

Is my text stored anywhere?

No. All processing runs as JavaScript in your browser. Nothing is uploaded to a server, nothing is logged, and nothing is stored.

Does it handle Windows and Mac line endings?

Yes. Text can use different invisible line-ending characters depending on the operating system it came from — Windows uses one style, Mac and Linux another. The tool recognises all of them, so you don't have to know or care which one your text has.

Will it remove the spaces between words too?

No. It only removes line breaks and, if you enable Trim spaces, extra spaces at the start and end of lines. The normal single spaces between words stay exactly as they are.

Can I undo after cleaning the text?

Your original text stays in the input box, so you can change the mode and clean it again as many times as you like. Nothing is destructive until you copy the result out — the source is always right there to try a different setting.

Is there a limit on how much text I can clean?

There's no set cap. You can paste a short paragraph or a whole document. Very large pastes may take a moment on older devices, but the tool processes everything and nothing gets cut off.

Does it work on my phone?

Yes. It's a single page that runs in any modern browser, so it works the same on a phone or tablet as it does on a computer. Paste, pick a mode, and copy the result.

Related tools