Shall I compare thee to a summer’s day?
Most grammar and writing sources say that both “with” and “to” are correct when used as prepositions after compare, comparable and comparison, and that they can be used interchangeably. However, there can be regional and contextual differences. The general consensus seems to be that most of the time, the slight differences in meaning will go unnoticed by readers.
There are several considerations ...
1 English is constantly evolving; preferred use 50 or 100 years ago is different from today.
A century ago, compared with was the more common usage; today, it is compared to that is more common.
2 Experts seem to belong to 2 different schools of use:
CLASSIFICATION DIFFERENCES: Some experts state that use depends on whether one is considering objects essentially similar (or of a similar “classification”) and objects from different “classifications”.
“To” is used to make an analogy; to highlight a likeness between disparate things,
while “with” usually refers to objects of similar classification: comparing cats to cars / comparing Bach with Mozart.
MEANING DIFFERENCES: Other experts mean that use of one or other stresses a subtle difference in meaning:
“compared to” stresses the similarity between items being compared;
while “compared with” considers both similarities and differences.
3 Finally, there are different trends in usage depending on different parts of speech:
Verb (to compare), intransitive verb, past participle (compared), adjective (comparable), noun (comparison)
see Oxford Dictionary’s web page for more information and examples … [accessed 7.8.2017]
References [all sites accessed 19.9.16 and 7.8.17]
Daily Writing Tips
Cites leading sources including: The Elements of Style, Associated Press Stylebook, Penguin Writers Manual
Detailed grammatical explanation
Line by Line, Claire Kehrwald Cook, Houghton Mifflin Co. 1985 p172