Find and Replace Line Breaks in Excel

When you want to create a line break (line feed) in a cell, you press Alt + Enter, to start a new line. You can put one or more line breaks in a cell, to make the contents easier to read. But how can you find and replace line breaks in Excel?

Find and Replace Line Breaks

Find Line Breaks in Excel

Line breaks are easy to add, but a little trickier to remove.

To find specific text in Excel, you can use Ctrl + F to open the Find and Replace dialog box. However, if you try to type Alt + Enter in the Find What box, you’ll just hear a beep from your computer. Excel won’t let you put that shortcut into the Find What box.

Instead of using Alt + Enter, you can use a special shortcut to enter a line break in the Find What box:

Ctrl + J 

Why does that work? A line break is character 10 in the ASCII character set, and the Ctrl + J shortcut is the ASCII control code for character 10.




Find and Replace a Line Break

To find a line break, and replace it with a space character, follow these steps. There is a video below, that shows the steps.

  1. Select the cells that you want to search
  2. On the keyboard, press Ctrl + H to open the Find and Replace dialog box, with the Replace tab active
  3. Click in the Find What box
  4. On the keyboard, press Ctrl + J to enter the line break character — NOTE: No text will appear in the Find What box — just a small blinking dot
  5. Press the Tab key on the keyboard, to move to the Replace With box
  6. Type a space character
  7. Then, click Find Next or Find All, to find the cells with line breaks.
  8. OR, click Replace or Replace All, to replace the line breaks with space characters.

NOTE: If these steps don’t work, try the tips and troubleshooting suggestions below.

Get more Excel data entry tips on my Contextures website.




Tips and Troubleshooting

Update: Here are a few tips and troubleshooting suggestions, to use while you find and replace line breaks in Excel. Thank you to everyone who commented, and added suggestions.

  • If Ctrl + J does not work, press the Alt key, and type 0010 on the number keypad (do not use the numbers above the letters)
  • If the Excel file has never been saved, try saving the file before doing this find and replace
  • Try doing this find and replace when you first open Excel, before using the Find box for any other searches. Or, try the next tip — you might have extra line breaks in the Find box.
  • Be sure that you aren’t inserting more than one line break in the Find box — the Find box looks empty after you type Ctrl+J, so it is easy to accidentally type in there again. To avoid this problem:
    1. Click on the Replace tab — you’ll see a light border around the word.
    2. Press the Tab key — that will select the Find What box, and anything that is entered there.
    3. Type Ctrl+J (that will replace anything that you previously typed in Find)

Video: Find and Replace Line Breaks

Watch this short video, to see the steps for adding a line break in a cell. Then see how to find the line breaks in Excel, and replace them with space characters.

_

Save

You may also like...

69 Responses

  1. Jon Peltier says:

    Ctrl-J is an easy way to put a line break into a number format. Unfortunately out stored working in chart axis tick label dialogs in Excel 2010 or 2013.

    • Jon Peltier says:

      Doh! “out stored” = “it stopped”. Stupid swype. That comment should be:

      Ctrl-J is an easy way to put a line break into a number format. Unfortunately it stopped working in chart axis tick label dialogs in Excel 2010 or 2013.

  2. Rick Rothstein (MVP - Excel) says:

    Regarding this statement…

    4. On the keyboard, press Ctrl + J to enter the line break
    character — NOTE: Nothing will appear in the Find What box

    Your “NOTE” is not entirely true… if you look carefully at the bottom left corner of the “Find what” field, you should see a small blinking “dot”… it is not a dot, rather, it is the top of the blinking text cursor on the line below (which Ctrl+J created) peeking through. If you press the left arrow, you will see the full text cursor because you have moved it to the other side of the Line Feed character placed by Ctrl+J… press the right arrow and the text cursor nearly disappears again as it move back to the other side of the Line Feed character again.

    • @Rick, thanks, you’re right about the blinking dot!

    • Leonardo says:

      you are AWESOME!!!!!!!!!!!!! You solved me a huge curiosity and any page about the subject helped me more than u!

      • Alphonse68 says:

        Forgive me, Leonardo, but in order to avoid misinterpretation of your comment, I will take it upon myself to correctly translate a very common mistake by native Spanish speakers. People who speak Spanish very often think that “any” means “no” or “none”.
        The comment should read:

        You solved me a huge curiosity and NO page on the subject helped me more than u!

        By the way, I also want to thank you, Debra, for solving a long desired solution to this Alt+Enter dilemma, and Ctrl+J is good news to me too.

        Cheers!!

  3. alexJ says:

    When I encounter unknown or invisible ASCII characters embedded in strings, I try to copy them in the edit line, then paste them into “Find what” field, or even use them in a “SUBSTITUTE” formula.

  4. Abhay says:

    Not working on Excel 2010

  5. Sonu says:

    Hi Debra,

    The above mentioned trick is working only in one cell. Thereafter it it is not working for other cells of the same sheet.

    Please advise why it so?

    Regards
    Sonu

  6. JB says:

    Couldn’t make this work in excel 2007 at all. The blinking dot appeared but it said it couldn’t find anything to replace.

  7. Matt says:

    Debra, thank you so much! This has really helped me.

  8. Damodar says:

    Hi,

    We can also give ‘Alt+0010’ instead of line breaks in the find what textbox. Same like Ctrl + J

    Thanks,
    Damodar

  9. Sofi says:

    great thank you, it worked out perfectly, I have excel 2010.

  10. Dave says:

    Great! it worked for me!!

  11. Fifi says:

    Great tip! I was getting inconsistant results using Alt+0010 to find and replace line breaks but Ctrl+J appears to be happily stable. Thanks for making this available.

    Fifi

  12. NewBee says:

    Awesome !! Worked Perfectly .. Thanks !!

  13. Christopher says:

    Thanks a lot. this saved almost a week work!! thank you so much

  14. H. Kazemi says:

    Great tip

    it saved me a lot of time

    thanks a lot

  15. Vasudev says:

    This tip doesn’t work on an unsaved document. The document should be saved and then Ctrl J works..

  16. Lynn Dirk says:

    I could not find this in the MS Excel support info, so THANK YOU SO MUCH!!! I knew it had to exist somewhere!

  17. Gergo Gyula says:

    Thank you for the hint, it worked!

  18. Thanks for this,
    It’s amazing how much you can learn and can forget if you haven’t used a technique after a few years.

  19. Danny W says:

    Thanks – this has really quickly resolved a long-standing problem I’ve had of having to create extra columns to place ‘replace’ results into (TRIM etc). Much better :)

  20. Day Day Kyaw says:

    Thank for Deleting Line Breaking

  21. Joe R says:

    NOTE: A variation of this can be used for INSERTING line breaks. I gather weekly status updates on team tasks that I want date stamped, so I pre-format the spreadsheet before team meeting:

    eg: Find/Replace all: 05/27/15 – with 06/03/15 – ^J05/27/15 –

  22. Biff N says:

    Does not work in my version of Excel 2010. I download a csv file from an Oracle table and convert it to Excel 2010. It contains a text field for which some have just the text and some the text and a carriage return or linefeed. I can clear those out using various, time consuming, methods such as copy and paste or =Clear(), but was hoping for a Find/Replace. I tried this as soon as I saw it. Sometimes I get the flashing dot when I type Ctrl+J, most times I don’t, and in neither case, does it find anything. Alt 0010 does not work either. Any ideas why it works for others but not for me? Am I possibly getting something besides a linefeed? Sure looks like one in the cell.
    Thanks,
    Biff

  23. Darío Puertas says:

    Really great tip, thank you!!!

  24. Ifor says:

    I’ve tried CTRL+J and it didn’t work (Excel 2010). I tried ALT+010 and it worked once, but I can’t get it to work again. Any clues?

    • @Ifor, Perhaps it’s a different character. Try to copy one from a cell, then use Ctrl+V to paste it into the Replace box.

      • Ifor says:

        I thought I had sorted this way back when, but I’m confused again.

        I start with e.g.

        The Farm

        The Bigfield

        Clapham

        Bedford

        after using find Ctrl+J and replace with a space I get this:

        The Farm
        The Bigfield
        Clapham
        Bedford

        Any ideas?

  25. Oswald Heger says:

    This is supposed to be quasi-standard of office software, and there is no obvious way to find information about this and many other little extras in the official documentation … MS must be kidding!

    This is as annoying as the missing “export” option for document formats – why does MS Office always assume you want to “convert” and carry on editing in a different format, instead of just exporting to it ?? Mind-boggling!

    Anyway, thanks for the valuable tip!

  26. Francois says:

    Awesome men ! You made my day !

  27. Dave says:

    Hi Debra,

    Ctrl + J – what a great tip, thanks! Can’t believe I never knew (or forgot) this.

    Looking over some of the other comments, I noticed a few people were having trouble getting this to work. It was “on and off” for me too, until I realized that I was occasionally inserting more than one Ctrl J into the the Find box. Because it’s invisible, it’s easy to do. The Find/Replace dialog retains it’s characters during a session, so when you re-open it, the Ctrl J box looks empty, but it’s not. Once I realized this, it worked every time for me. Hopefully, this may be helpful to others having problems.

    Regards
    Dave

  28. DJS says:

    I have searched high and low to do something similar, but slightly different… I would like a formula to remove everything to the right of a line break in a cell… I know a line break is Chr(10), but can’t figure out how to incorporate that into the “=replace” formula. Any help would be hugely appreciated!

    • Alphonse says:

      Sorry… I forgot to mention that once you insert the Ctrl+J character and the type the *, you will not see the asterisk either because it is below the viewing area of the Find field… you will only see the “blinking dot”. If you play with the arrow keys you will be able to follow the dot and know how many characters, if ever, you have typed after the Ctrl+J. That would be in case you want to replace or erase a specific string. Play with it… type several characters after the Ctrl+J and then move the cursor back and forth with the arrow keys.
      Cheers

  29. Alphonse says:

    Hi DJS,
    Have you tried inserting Ctrl+J and an asterisk in the find field?
    When you insert a Ctrl+J in the Find field, you will notice a tiny blinking dot at the beginning of the field.
    That is the cursor that has gone to the “next line” as it does in Excel when we insert an Alt+Enter. If you press the Left arrow you will see the cursor fully reappear in the field and the Right arrow will make it go back down.
    Anyway, back to our scheduled program, simply insert a Ctrl+J followed by an *.
    I type capital J for clarity, but you actually type a lower-case j.
    I hope this helps.
    Cheers

    • Sai Karthik Iduri says:

      Hi Alphonse,

      I tried giving the asterisk afte CTRL+J.. But its replacing the entire second line with space.
      So my result is coming this way.
      Existing:
      Retired
      Policy

      Expected:
      Retired Policy

      Actual:
      Retired

      Any other tricks I can try.

  30. sadik says:

    Thanks,

    Very useful information

  31. Steve S says:

    Hi DJS

    Have you tried this: –

    =LEFT(A1,FIND(CHAR(10),A1)-1)

    where cell A1 contains the multi line text

  32. Jure says:

    waa…. you saved me hours of manual work.

    Thanks a lot mate!!!

  33. Claudia says:

    Great help!!

  34. Fernando says:

    Thank you, very useful!

  35. VMF says:

    Any suggestions on doing the reverse? I need to replace a special character “|” with a line break. When I try this above mentioned method using the Replace All option, all the data in each cell is deleted where the “|” exists. Additional Note: I am selecting an entire column, but also tried it on an individual cell.

  36. Janos says:

    Debra, You are the best!

    Thank you!

  37. Raghuvir Jhaveri says:

    Incredible – the video really helped !!! I have a massive table in word with tonnes of line break that I was struggling to get into excel. I replace all line breaks by a text – my name – and then in excel I replaced my name to crtl+J

  38. Hareesh Kumar Pabbichetty says:

    Really helped and saved my efforts. Thanks a lot!

  39. Sai Karthik Iduri says:

    Hi,
    I tried, Capital J to replace the line break and the formula and all tips and tricks from this conversation.
    unfortunately, nothing turned out.
    I am trying to replace a line break with a space in a column of my .CSV sheet.

    I copied the column and paste into another blank sheet and saved it and tried again with all possible options. But couldn’t get the replacement. I can see that copy paste is the only option now to get my work done. But I don’t want to take a chance of losing the original data in replacing the cells when I filter them out during copy paste.

    Any help is greatly appreciated. Thank you!

  40. NameWithheld says:

    Before seeing “Ctrl+J” on this webpage, I was at a total loss.
    I had an MSWord table containing forced line returns within cells and when copying the info to Excel it was putting the “next line” info, not into the same cell but into a new cell.

    This (plus a couple of logical gyrations) will save me a couple of hours today and several hours in the future. . . PLUS it may appear that I know some “magic”. ; – )

  41. e-learning says:

    thanks, really usefull the control + j

  42. George says:

    Thank you so much for this useful tip!

  43. Ifor says:

    This is so frustrating! Sometime Ctrl+J works and sometimes it doesn’t. I need to do this once every three months and each time I think I’ve cracked it, but then it doesn’t work next time.

  44. Len Vaz says:

    It was really helpful, i was struggling with formulas to do this simple task.

  45. Giles Tilling says:

    Hi – I have line breaks (Ctrl+J) that I would like to replace with paragraph breaks (^p in Word).
    Do you know how to do this in Excel?
    I know you usually want to get rid of them in Excel, but I need them for my translation software to detect the end of a segment.
    (At the moment I can export to Word or change the segment definition in the translation software, but changing the source Excel file would be the neater solution). Many thanks
    Giles

  46. Adi says:

    Thanks Much

  47. Matt says:

    Is there a way to replace the line break with the tab button? Using the example in your video, I am looking to shift the “two”, “six”, and “seven” over to column C.

  48. Magda says:

    This is great! Thank you! :)

  49. Sumer says:

    It’s working, thanks for giving this useful example..

Leave a Reply to George Cancel reply

Your email address will not be published. Required fields are marked *