Determining, whether two complex file types are equalish is always very tricky, if not impossible. DOCX contains much more than just some text and whether it is bold or not.
There are ways to make the document look exactly the same with different properties and there are also lots of metadata saved in (the author for example). It is then not just a technical problem, it is more about a philosophical problem. Let me give you an example:
You are expected to compare two cars and say, if they are the same or not. There are some obvious cases when they are objectively different, like a heavy lorry and a small city EV. But what if they are of the same type, but of a different color? Or same type, same color, but different amount of fuel in the tank?
The same goes for DOCX. Same text, but different colors? Same content, but different authors? Same … but different …?
Maybe you can disclose some more information about what you are trying to achieve, otherwise I doubt we can help you more.
If you really need to somehow compare two DOCX files (or any other types of similar complexity), find a library that can parse them and build the logic by yourself. However one might spend years doing so without a satisfactory result.
If you are more into dirty hacky solutions, use a library to build an image of the pages of the document and compare them as images. This will ensure the pages look the same. However, based on your definition of equality, that doesn't have to mean they are the same documents.
If you can choose another file format, it might be a good idea to do so. However, there will still be some tricky parts. Even Markdown (the language we use to format Q&A on this site) cannot be compared byte to byte.
This
**weird**
post
will render the same as
This **weird** post
into
This weird post.