Map Extract
Free tool

Remove line breaks and rejoin text

Text copied out of a PDF, an email or a narrow web column often breaks in the middle of sentences. Paste it here to rejoin the lines, either keeping the paragraphs apart or running everything into one line.

Runs in your browser. Nothing you enter is uploaded.

Example: a supplier's brochure blurb for a proposal

A web agency is writing a proposal for a window fitter and copies the firm's own description out of its PDF brochure, to quote back in the proposal. Each line of the PDF arrives as a separate line, so the paragraph looks like a poem.

In the default mode, single line breaks become spaces and the blank line between the two paragraphs survives, so the result can go straight into a document.

Input
We fit and repair
sash windows across
North Yorkshire.

Free quotes within
48 hours.
Result
We fit and repair sash windows across North Yorkshire.

Free quotes within 48 hours.

Rejoining lines

  1. Paste the broken text

    Anything with unwanted line breaks. Example buttons load text copied from a PDF, an address and two short paragraphs.

  2. Choose what replaces each break

    Use the Replace line breaks with menu. The three choices are compared in the table below.

  3. Copy the result

    Spaces either side of each break are tidied, so you do not end up with doubled spaces where lines met.

The three modes compared

ModeBest forExample result
A space, but keep paragraphsProse copied from PDFs, emails and web pagesTwo paragraphs, each on one line, with a blank line between
A space (one paragraph)Putting an address or a list into one spreadsheet cellTidewell Joinery 12 Dock Street Hull HU1 1AA
NothingCodes, keys or long numbers split over several linesABCD, EFGH and IJ on three lines become ABCDEFGHIJ

Two things to check afterwards

Words that the PDF hyphenated at the end of a line keep their hyphen, so free- on one line and standing on the next come out as free- standing. A quick find and replace for a hyphen followed by a space, replaced with nothing, joins them, though it will also join genuine dashes written with spaces, so review the result.

Bullet lists lose their structure if they have no blank lines between items, because each bullet is just another line break. Copy lists separately, or add a blank line between items before you paste.

Questions people ask

Why does text copied from a PDF have line breaks in odd places?

A PDF stores text as it is laid out on the page, line by line, rather than as flowing paragraphs. When you copy it, each printed line becomes a separate line in the clipboard. Rejoining with spaces, while keeping the blank lines between paragraphs, restores the original sentences.

How do I put an address on one line?

Paste the address and choose A space (one paragraph). Each line break becomes a space, giving one line you can paste into a single spreadsheet cell or a form field. If you want commas between the parts, use find and replace on the original instead, replacing line breaks with a comma and a space.

Can I remove line breaks in Word or Excel?

In Word, Find and Replace can search for the paragraph mark (^p) and replace it with a space. In Excel, a formula such as =SUBSTITUTE(A2,CHAR(10)," ") removes the line breaks inside a cell. This page is quicker when the text is not yet in either program.

Where your data goes

Lines are rejoined by the page script on your computer. Brochure text, emails and addresses you paste are not uploaded.

Checked against the tool on

Top