Text & Data Tools007

Remove Line Breaks

Turn hard-wrapped text from PDFs and emails back into clean, flowing paragraphs.

Line breaks

Paste or type text to start

Processed locally · 0 bytes sent

How to remove line breaks from text

  1. Paste your text into the Input box, or type it.
  2. Pick a mode: Replace with space (the default) joins everything into one line, Keep paragraphs joins lines but keeps the blank-line gaps, and Remove deletes the breaks outright, along with any spaces around them.
  3. Read the result in the Output box. It updates as you type, and the counters show characters, words and lines before and after.
  4. Click Copy to put the result on your clipboard, or Download .txt to save it as a file.

Why use this tool

  • Text copied from a PDF

    A PDF records where each line is drawn on the page, not where a paragraph starts and ends. Copy a paragraph and you usually get a hard break at the end of every visual line, which turns into a ragged column when you paste it into a document or a form. Replace with space puts the sentences back together.

  • Hard-wrapped emails and plain-text files

    Plain-text email, old README files and many terminal outputs wrap at a fixed width of around 72 to 80 characters. Keep paragraphs rejoins the lines of each paragraph and leaves the gaps between paragraphs where they were.

  • Fields that only take one line

    Spreadsheet cells, CSV values, meta descriptions, image alt text and many web forms expect a single line. Collapse a multi-line note or address into one line before you paste it in.

  • Strings wrapped across lines

    Long URLs, base64 blocks and API keys often arrive split over several lines in emails or logs. Remove mode deletes each break together with the spaces or indentation around it, so the pieces join with nothing in between and the string comes back in one piece.

Private by design

The text you paste or type is processed in this browser tab. It is never uploaded or stored, so you can clean up internal documents or customer data without it leaving your device. No account needed.

Good to know

How the modes work. The tool recognises all three line-ending styles: Windows CRLF, Unix and macOS LF, and the lone CR of classic Mac files.

  • Replace with space turns every run of line breaks into exactly one space. It also absorbs spaces or tabs at the end of one line and the start of the next, so joins never leave double spaces. Breaks at the very start or end of the text are dropped.
  • Keep paragraphs treats an empty line, or a line holding only spaces or tabs, as a paragraph boundary. Lines inside a paragraph are joined with one space, and paragraphs are separated by a single blank line in the output.
  • Remove deletes each break together with the spaces and tabs on either side of it (trailing spaces, indentation), so the pieces join with nothing in between. Use it for text that must not gain a space, such as a wrapped URL or key. Other characters at the start of a line, such as the > of a quoted email, stay where they are.

What it does not do. It does not repair words hyphenated at a line end: exam- at the end of one line and ple on the next becomes exam- ple. Spacing inside lines is left as it is. To tidy doubled spaces or tabs as well, run the result through Remove Extra Spaces.

Counters. Characters are counted as you see them: an emoji counts as one, even a flag or a family emoji, and so does a Windows line break (CRLF). A word is any run of characters without whitespace.

Example

In — Hard-wrapped email

The quarterly report is
attached for review.

Please send comments
by Friday.

Out — Keep paragraphs mode

The quarterly report is attached for review.

Please send comments by Friday.

Frequently asked questions

Why does text copied from a PDF have line breaks in the middle of sentences?

PDF is a page-layout format. It stores the position of each line of text, not the paragraph structure, so most PDF viewers insert a line break at the end of every visual line when you copy. Replace with space or Keep paragraphs rebuilds the flowing text.

Will it merge all my paragraphs into one block?

Only in the Replace with space and Remove modes. Choose Keep paragraphs to keep every blank-line gap: the lines inside each paragraph are still joined, but the paragraphs stay separate.

What is the difference between removing line breaks and replacing them with spaces?

Remove deletes the breaks (and any spaces around them), so "end of line" followed by "next line" becomes "end of linenext line". Replace with space puts one space where each break was, which is what you want for normal prose.

Does it handle Windows and Mac line endings?

Yes. Windows CRLF, Unix and macOS LF, and the lone CR used by classic Mac files are all recognised. Line breaks in the output, such as the gaps kept by Keep paragraphs, use LF.

Can I do the same thing in Microsoft Word?

Yes, with Find and Replace: search for ^p (paragraph mark) or ^l (manual line break) and replace it with a space. That also joins your real paragraphs, unless you first swap every ^p^p for a placeholder and restore it afterwards. Keep paragraphs mode does both steps at once.