Compare Two Text Files Using NotePad++

September 3rd, 2010 Leave a comment Go to comments

This is an easy trick that you can use to merge two files manually in case you don’t have an IDE while coding. I have used it few times to compare Javascript files before checking in the code in repository.

Open both files using NotePad++.

compare text files in notepad++

Then go to Plugins> Compare> Compare.

Both files will now show up side by side with differences highlighted.

Now you can easily check and copy the lines needed from one file to another.

Related posts:

  1. Small Free File Recovery Software That Can Restore Recycle Bin Deleted Files Really Fast
  2. Get Notified Immediately If Someone Hacks Your WordPress Files
  3. How to Play MKV files in Windows Media Player
Categories: Windows Tags:
  1. Joao Figueira
    November 30th, 2010 at 01:35 | #1

    Thanks!

  2. Rahul Dev
    December 26th, 2010 at 04:55 | #2

    When ever i click compare option… it hangs for 1~2 sec and my screen goes black.. My OS is win 7 .. on core i3 with 2 GB RAM.. any solution?

    • admin
      December 26th, 2010 at 13:59 | #3

      Not sure what the issue is. I also have Windows 7. And anyways your you configuration is not a problem to run NotePad++ ;)
      Have you tried to compare other files?

  3. Adam
    January 7th, 2011 at 03:04 | #4

    I have i7 8GB RAM and comparing 2 files bigger than 20 Mb with Notepad++ will give me BSOD or just shutdown my PC.
    The plug-in itself can’t handle the size of files, I love the notepad++ it’s my main text editor , have been using it for few years now so I hope eventually comparing plug-in will get better.
    It happens to all my 3 PC’s Win 7 x64
    PS. I have UEStudio Latest version + UltraCompare (Genuine License) and it does the job, 2 registry files over 600 MB no problem, but it uses 100% CPU to do that, sluggish editor, I only use for huge files but the day Notepad++ will handle bigger files I will say good bye to everything else best editor out there.

  4. March 11th, 2011 at 06:13 | #5

    Brilliant. Thanks for doing this post.

  5. yaya
    April 7th, 2011 at 23:16 | #6

    Hello,

    can you guys let me know if there is a way after using plugin compare in notepad ++ to extract the differences between files compared?
    thanks

  6. bas vijfwinkel
    July 11th, 2011 at 13:50 | #7

    The plug-in itself can’t handle the size of files,

    It does not seem to be the size of the files. It happens to me with files less than 1MB. =(

  7. steve
    July 19th, 2011 at 22:31 | #8

    When I use the compare plugin built into Notepad++ to compare line text between two text files, how do I select & copy just the added lines (highlighted in green with the + sign icon to the left)?

    What I’m trying to do is simply select all the line differences in one text file so that I can copy and paste them into a new text file.

    I searched everywhere and I figure out how to do this.

    Any suggestions on how to accomplish this are most appreciated.

    Thanks

  8. MacB
    July 20th, 2011 at 11:43 | #9

    I may have a solution to the windows 7 issue.

    Try unchecking the “Synchronize Verticle/Horizontal Scrolling” buttons, THEN use compare.

    I was having crushing display issues, and this cleared it right up for me.

    Hope this help!

  9. August 4th, 2011 at 22:00 | #10

    I have exact same question as Steve, trying to just select all the “added” lines so that I can post them in a separate file altogether.

  10. Dave
    August 11th, 2011 at 21:44 | #11

    I just ran a “Dr. Web” scan. It reported my “Hosts” file as corrupt & asked if I wanted to restore it to the “Default” file. Being the trusting soul that I am, I clicked “Yes”. WinPatrol spotted the change & asked if I accepted it. After a call to TJ the Guru, I found Notepad++ & ran the “Compare” function. Turns out that had I accepted the change, Dr. Web would’ve deleted my ENTIRE “Hosts” file. There’s probably more here than meets my ignorant eye, but this could’ve been ugly… Thanks for the app & good luck to us all!!! World peace, everybody!!!

  11. Doodles
    August 20th, 2011 at 00:29 | #12

    Works like a charm… Thanks for sharing.

  12. sabarish
    October 4th, 2011 at 15:34 | #13

    Hey..!!! thanks yar.. you ve saved my time..!!!

  13. bob
    October 6th, 2011 at 22:36 | #14

    This comparison tool is terrible. It doesn’t even let you compare the lines directly, it just tells you where the differences are.

  14. Jack
    October 14th, 2011 at 20:19 | #15

    I also have the same problem as mentioned by Steve and Justin. I would love to be able to select all of the added lines but have not been able to find out how to do this.

  15. December 15th, 2011 at 05:52 | #16

    Great tool thanks!!

  16. prawin
    January 25th, 2012 at 21:48 | #17

    much helpful thank yo so much

  17. ChazZ
    February 7th, 2012 at 13:59 | #18

    @Rahul Dev
    I had the same problem. Go to Plugins->Compare and uncheck Navigation bar. Now it does not go black and works fine for me. I also checked – ignore spacing.

  18. jdsony
    February 10th, 2012 at 17:36 | #19

    i can’t see that compare option in plugins tab. i am using v5.9.8. which version has got that option.

  19. derc
    February 13th, 2012 at 16:03 | #20

    @Rahul Dev
    same problem here. When I click compare it crashed all windows, i.e. all windows go black but can still be used.

  20. Phil
    February 13th, 2012 at 22:33 | #21

    Don’T have the compare option in the latest version

  21. Patrick
    March 1st, 2012 at 18:15 | #22

    Fantastic plugin, just what i was looking for!

    Thanks! :)

  22. Vinayaka
    April 18th, 2012 at 15:00 | #23

    Awesome… wonderful… It will handle more than 2.5 MB file.

    Thanks… :)

  23. Andy
    April 19th, 2012 at 00:00 | #24

    @Phil
    Go to Plugins menu > Plugin Manager > Show Plugin Manager > check ‘Compare’ from the list of available plugins and click ‘Install’.

    Worked a treat for me! :)

  1. No trackbacks yet.