You can use the prepositions “to”, “with”, and “against” with the verb compare in slightly different contexts.
We use “compare to” when we want to try and bring a comparison together and “compare with” when the comparison is already obvious. We use “compare against” when we want to verify if something is correct.
We use “compare to” when we want to show a comparison that the other person hadn’t thought of before.
These cannelloni are amazing!
Bah! They are terrible compared to the way my grandmother makes them.
I can compare your music to a car alarm and an ambulance.
There is often a metaphor involved when we use “compare to”.
We use “compare with” when we have two things side by side and want to show similarities and especially differences.
Compare my painting with yours. Mine is so much better!
Let’s compare your results with mine.
We use “compare against” when we are verifying or checking something.
Compare this print against the original. It is obviously a fake.