Text Tools
Fancy Text
Calculators
Everyday helpers

Quick calculators

Percentages, money, grades, math, age, sleep and time tools.

Browse all calculators
% Percentage Calculator Percent of, change and difference ½ Fraction Calculator Add, subtract and simplify fractions A+ Grade Calculator Weighted grade and final exam score 4.0 GPA Calculator Semester and cumulative GPA Av Average Calculator Mean, median, mode and range σ Standard Deviation Calculator Spread of a data set, step by step 1:2 Ratio Calculator Simplify and scale ratios ≈ Rounding Calculator Round to any place or figure 1.0 Significant Figures Calculator Count and round significant figures ft² Square Footage Calculator Area of rooms and shapes Tp Tip Calculator Work out the tip and split the bill Ex Expense Calculator Track and total your spending Ag Age Calculator Exact age in years, months and days Zz Sleep Calculator Find a good time to sleep or wake t± Online Time Calculator Add and subtract hours and minutes Di Discount Calculator Sale price, percent off, stacked deals St Sales Tax Calculator Add, remove or find tax, VAT mode Si Simple Interest Calculator Interest, principal, rate or time Ci Compound Interest Calculator Growth, deposits, schedule and APY Pm Payment Calculator Loan payment, total interest Ir Interest Rate Calculator Rate from amounts or payments Fv Future Value Calculator Deposits, growth, compounding Pv Present Value Calculator Discount a lump sum or payments Fn Finance Calculator Solve N, rate, PV, PMT or FV Ro ROI Calculator Net gain, ROI and break-even Cm Commission Calculator Flat, tiered or base plus commission Sa Salary Calculator Hourly, weekly, annual pay E+ Scientific Notation Calculator Convert and calculate in E notation
Health
Dev Tools
More
Menu
Text Tools
Fancy Text
Calculators
Everyday helpers

Quick calculators

Percentages, money, grades, math, age, sleep and time tools.

Browse all calculators
% Percentage Calculator Percent of, change and difference ½ Fraction Calculator Add, subtract and simplify fractions A+ Grade Calculator Weighted grade and final exam score 4.0 GPA Calculator Semester and cumulative GPA Av Average Calculator Mean, median, mode and range σ Standard Deviation Calculator Spread of a data set, step by step 1:2 Ratio Calculator Simplify and scale ratios ≈ Rounding Calculator Round to any place or figure 1.0 Significant Figures Calculator Count and round significant figures ft² Square Footage Calculator Area of rooms and shapes Tp Tip Calculator Work out the tip and split the bill Ex Expense Calculator Track and total your spending Ag Age Calculator Exact age in years, months and days Zz Sleep Calculator Find a good time to sleep or wake t± Online Time Calculator Add and subtract hours and minutes Di Discount Calculator Sale price, percent off, stacked deals St Sales Tax Calculator Add, remove or find tax, VAT mode Si Simple Interest Calculator Interest, principal, rate or time Ci Compound Interest Calculator Growth, deposits, schedule and APY Pm Payment Calculator Loan payment, total interest Ir Interest Rate Calculator Rate from amounts or payments Fv Future Value Calculator Deposits, growth, compounding Pv Present Value Calculator Discount a lump sum or payments Fn Finance Calculator Solve N, rate, PV, PMT or FV Ro ROI Calculator Net gain, ROI and break-even Cm Commission Calculator Flat, tiered or base plus commission Sa Salary Calculator Hourly, weekly, annual pay E+ Scientific Notation Calculator Convert and calculate in E notation
Health
Dev Tools
More
Blog Get the Chrome extension
Blog Get the Chrome extension
Guide

Remove Line Breaks From Text (Word, Excel, Google Docs)

By Case Converter Tool · Updated · 6 min read

Quick answer: To remove line breaks from text, replace each break with a space. In Word, press Ctrl+H, find ^p and replace it with one space. In Excel, use =SUBSTITUTE(A2,CHAR(10)," "). In Google Docs, tick Match using regular expressions and replace \n with a space. Or paste the text into a paragraph to single line converter.

Why copied text has line breaks in the middle of sentences

Copy a paragraph from a PDF or a plain-text email, paste it somewhere else, and you often get a line break at the end of every visual line instead of only at the end of each paragraph. The words are fine. The breaks are the problem: they chop sentences into short lines that will not reflow when you change the page width or the font.

The fix is to swap each break for a space. First, work out which kind of break you have, because each program names them differently:

  • Word paragraph mark. Made by pressing Enter. Word’s search code is ^p.
  • Word manual line break. Made by pressing Shift+Enter. The code is ^l.
  • Excel line break inside a cell. A line feed character, written CHAR(10) in a formula.
  • Google Docs. Its regular expression search uses \n for a line break.

Quick reference card with the codes for finding line breaks in Word, Excel and Google Docs

Remove line breaks from text in Word

Word’s Find and Replace box accepts special codes. Microsoft’s table of special characters gives ^p for a paragraph mark and ^l for a manual line break.

  1. Select the text you want to fix.
  2. Press Ctrl+H to open the Replace tab.
  3. In Find what, type ^p. In Replace with, type a single space.
  4. Click Replace All.

If the breaks came from Shift+Enter, search for ^l instead. Microsoft also notes that ^p does not work in the Find what box when Use wildcards is switched on, so leave that box unticked.

This turns every paragraph into one block, including the real ones. To keep genuine paragraphs, assuming a blank line separates them, run three Replace All passes in this order:

  1. Find ^p^p and replace it with a marker that is not in your text, such as ##.
  2. Find ^p and replace it with one space.
  3. Find ## and replace it with ^p^p.

Remove line breaks in Excel

A line break inside a cell is a line feed, CHAR(10). The cleanest formula swaps it for a space so the words on either side stay apart:

=SUBSTITUTE(A2,CHAR(10)," ")

  1. Type the formula in an empty column beside your data and press Enter.
  2. Drag the fill handle down to cover the other rows.
  3. Copy the results and paste them over the originals as values, then delete the helper column.

Wrap the formula in TRIM if you also want stray double spaces tidied up. There is a shorter option too. Microsoft’s CLEAN documentation shows =CLEAN(A2) removing CHAR(10) and CHAR(9) from a string. The catch is that CLEAN removes the character and puts nothing in its place, so a break between two words will glue them together. It also skips a few nonprinting Unicode characters, so use SUBSTITUTE when the breaks sit between words.

Remove line breaks in Google Docs

Docs works differently: its Find and replace box can search with regular expressions. Google’s find and replace help describes the option as “Match using regular expressions”.

  1. Click Edit, then Find and replace.
  2. Tick Match using regular expressions.
  3. In Find, type \n. In Replace with, type one space.
  4. Click Replace all.

Google says anything you type in the Replace with box is inserted as literal text, which suits this job because the replacement is only a space. Every break it finds is replaced, including the ones between real paragraphs. Check the result when you finish. If nothing changed, or the layout looks wrong, paste the text into the online tool below instead.

Remove line breaks from text online

When the text comes from a PDF or an email and you have not opened it in any program yet, a browser tool is the shortest route. The Paragraph to Single Line Converter works in four steps:

  1. Paste your text, or open a .txt file.
  2. Choose what joins the lines. The default is a space.
  3. Pick the output: plain text, a JSON string or a CSV cell.
  4. Copy the result or download it as a .txt file.

The options go beyond a plain join:

  • Join lines with a space, nothing, a comma, a comma and space, a semicolon, a pipe, a tab or text of your own.
  • Keep paragraph breaks joins the lines inside each paragraph and leaves one blank line between paragraphs.
  • Join words split by a hyphen rejoins “inter-” and “national” into “international” when a line ends with a hyphen.
  • Collapse repeated spaces, Trim every line and Remove duplicate lines clean up what is left.

Counters show the characters, words, lines in, lines out and breaks removed, so you can see the change at once. The tool reads Windows, Unix and old Mac line endings, is free, has no character limit and runs in your browser. Its page lists a few limits. Without blank lines it cannot tell a wrapped line from a deliberate one. Hyphen joining can wrongly merge real hyphenated words such as “well-known”. Joining with nothing glues words together, so save that for codes and IDs.

Which method fits your situation

Your situation Best method
Text copied from a PDF or email, no program open yet Online tool with Keep paragraph breaks
Text already in a Word file Ctrl+H, find ^p, replace with a space
Hundreds of cells with line breaks SUBSTITUTE with CHAR(10) in a helper column
Text in a Google Docs file Find and replace with regular expressions
A list that must become a comma-separated line Online tool, Join lines with a comma
A value for code or a spreadsheet import Online tool, output as a JSON string or CSV cell

Fixing the usual side effects

  • Words run together. You replaced the break with nothing. Run it again with a space.
  • Double spaces. The original lines already ended in a space. Use the tool’s Collapse repeated spaces option, or in Word replace two spaces with one.
  • Paragraphs merged into one block. Use Keep paragraph breaks in the tool, or the three-pass marker method in Word.
  • Odd invisible characters. Collapse and Trim do not remove zero-width spaces. The remove text formatting tool has an option for them.
  • All capitals after the join. If the PDF text arrived in capitals, run it through the sentence case tool afterward.

If the copied text is the only thing standing between you and a clean paragraph, the Paragraph to Single Line Converter joins the lines in one click and keeps your original in the input box. Paste, pick the separator, and copy.

Frequently asked questions

How do I remove line breaks from text without losing paragraphs?

In the online tool, tick Keep paragraph breaks. In Word, replace ^p^p with a marker, replace ^p with a space, then swap the marker back to ^p^p. This only works when a blank line separates your real paragraphs.

What is the difference between ^p and ^l in Word?

The code ^p finds a paragraph mark, the break you make with Enter. The code ^l finds a manual line break, the one you make with Shift+Enter. Search for whichever your text contains.

Does the CLEAN function remove line breaks in Excel?

Yes. Microsoft’s example shows CLEAN removing CHAR(10) from a string. It leaves no space behind, so words around the break can join. SUBSTITUTE with CHAR(10) and a space avoids that.

Is it safe to paste private text into an online line break remover?

The Paragraph to Single Line Converter says it runs in your browser and does not upload or store your text. If the text is truly sensitive, the Word and Excel methods above stay on your own device.