Compare Two Text Files Using NotePad++

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.

27 thoughts on “Compare Two Text Files Using NotePad++

  1. Rahul Dev

    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?

    Reply
    1. admin Post author

      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?

      Reply
  2. Adam

    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.

    Reply
  3. yaya

    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

    Reply
  4. bas vijfwinkel

    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. =(

    Reply
  5. steve

    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

    Reply
  6. MacB

    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!

    Reply
  7. Dave

    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!!!

    Reply
  8. bob

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

    Reply
  9. Jack

    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.

    Reply
  10. Andy

    @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! :)

    Reply
  11. Giorgos

    hello,
    Is there any way to copy from comparison results with highlighted text?
    The command “Copy text with syntax highlighted” doesn’t work!

    Reply

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>