Remove line breaks online
Paste text with broken lines (from a PDF, an email or a web page) and get clean paragraphs. Free, no sign-up. Your text never leaves this page: the tool runs in your browser and sends nothing anywhere.
One-click cleanups
Pick one: you see every match in the result first, then press Replace. Same patterns as the ReplaceKit add-on for Google Docs.
Line breaks
Clean-up
Find & replace (optional)
What each option does
| Option | Use it for |
|---|---|
| Join broken lines, keep paragraphs | Text copied from a PDF or a plain-text email: every printed line ends in a break, and paragraphs are separated by a blank line. Lines are joined; blank lines stay as paragraph breaks. |
| Join lines that don't end a sentence | PDF text with no blank lines between paragraphs. A line ending in . ? ! or : (or a closing quote after one) keeps its break; all others are joined. |
| Remove all line breaks | One single line, e.g. for a form field, a spreadsheet cell or a list turned into a, b, c (pick "a comma and space"). |
| Find & replace | Runs after the line-break step. Plain text by default; tick "Regular expression" for patterns like (\d+)-(\d+) and $2-$1 in the replacement. To put each item on its own line, find , and replace with \n. |
A line ending in a hyphen is only rejoined when the next line starts with a lowercase letter, so sen- + tence becomes sentence but Jean- + Paul keeps its hyphen. A word that really is hyphenated at a line end (well- + known) loses its hyphen too: untick the box and check those by hand if it matters.
What each one-click cleanup does
The cleanups run on the result, after the line-break step and before your own find & replace. Applied ones show a tick; click again to undo. Link straight to one with /remove-line-breaks/#double-spaces (any id below): the page opens with line breaks left alone and that cleanup ready.
| Cleanup | What changes | Pattern (regex) |
|---|---|---|
| Double spaces | Two or more spaces between words become one. | (?<=\S) {2,}(?=\S) |
| Space before , . ; : ! ? | Remove spaces before , . ; : ! ? (not before a decimal like .5). | (?<=\S)[ \u00a0]+(?=[,.;:!?](?!\d)) |
| Trailing spaces | Remove spaces and tabs at the end of each paragraph. | [ \t\u00a0]+$ |
| Empty paragraphs | Empty (or blank) paragraphs between text are removed: double paragraph breaks become one. | \n(?:[ \t\u00a0]*\n)+ |
| Line breaks → paragraphs | Soft line breaks (Shift+Enter) become paragraph breaks. | \v |
| Straight → curly quotes | Straight quotes become curly: opening after a space, bracket or dash, closing otherwise (apostrophes too). | (?:(?<=^|[\s\v(\[{\u2013\u2014/-])(["'])|(["'])) |
| Curly → straight quotes | Curly and low quotes become straight " and '. | [\u2018-\u201f\u2032\u2033] |
| Non-breaking spaces | Non-breaking and narrow no-break spaces become normal spaces. | [\u00a0\u202f\u2007] |
In a text box every line break is already a paragraph break, so "Line breaks → paragraphs" finds nothing here; it matters in Google Docs, where Shift+Enter makes a soft line break that looks like a new paragraph but is not one.
Is my text private?
Yes. The tool is two scripts, tool.js and cleanups.js (readable, no libraries), which work only on what is in the box. It makes no network requests and stores nothing; you can disconnect from the internet after the page loads and it keeps working. Separately, the page sends one cookie-free page view count when it loads (the page address and the referring site, never your text; see privacy).
In Google Docs: ReplaceKit does this in one click
Copying text out of a document and back loses its headings, bold and links. Google Docs' own Find and replace can't match a line break at all (why, and the workarounds). ReplaceKit, the Google Docs add-on we are building, does the same clean-up inside the document: its Find box matches paragraph breaks (\n) and soft line breaks (\v), only in your selection if you want, with formatting kept and a preview of each match. The same eight one-click cleanups sit at the top of its sidebar.
ReplaceKit is built and in testing. It is not in the Google Workspace Marketplace yet. Leave your email and we send one message when you can install it.
Free version: every find and replace, no click limit or trial clock.
ReplaceKit guides
- Free online tool: bulk find and replace (a whole list of find -> replace pairs at once)
- How to remove line breaks in Google Docs (PDF paste fix)
- Find and replace with a line break or paragraph break in Google Docs
- Find and replace formatting in Google Docs (bold, colour, highlight)
- Regex find and replace in Google Docs: capture groups and wildcards
- Find and replace in a selection only in Google Docs (and fixes when it is not working)