Calibre has a compare EPUBs built in:
https://manual.calibre-ebook.com/diff.html
Open up your EPUB in Calibre's Editor, then press
File > Compare to another book, and choose the one you want to compare to.
EPUBs are just HTML files in a ZIP file. You can just unzip the EPUB and use all the different Code Comparison programs to compare files:
https://en.wikipedia.org/wiki/Compar...mparison_tools
and there are probably quite a few online code comparison tools.
I personally use/prefer Beyond Compare (Paid, proprietary):
http://www.scootersoftware.com/
I found it worked better than the other tools I tested. (Working on large Non-Fiction books with large paragraphs.) Some other tools I tested misaligned very easily, and the entire comparison algorithm would get thrown off beyond that point.
If you are working on something like Fiction with shorter paragraphs, those other tools may work absolutely perfectly for you.