Dimuon and dielectron mass spectra, obtained from data resulting from proton-proton collisions at 8 TeV and recorded by the CMS experiment, are used to search for both narrow resonances and broad deviations from standard model predictions. The data correspond to an integrated luminosity of 20.6 (19.7) fb −1 for the dimuon (dielectron) channel. No evidence for non-standard-model physics is observed and 95% confidence level limits are set on parameters from a number of new physics models. The narrow resonance analyses exclude a Sequential Standard Model Z SSM ′ resonance lighter than 2.90 TeV, a superstring-inspired Z ψ ′ lighter than 2.57 TeV, and Randall-Sundrum Kaluza-Klein gravitons with masses below 2.73, 2.35, and 1.27 TeV for couplings of 0.10, 0.05, and 0.01, respectively. A notable feature is that the limits have been calculated in a model-independent way to enable straightforward reinterpretation in any model predicting a resonance structure. The observed events are also interpreted within the framework of two non-resonant analyses: one based on a large extra dimensions model and one based on a quark and lepton compositeness model with a left-left isoscalar contact interaction. ... mehrLower limits are established on M S , the scale characterizing the onset of quantum gravity, which range from 4.9 to 3.3 TeV, where the number of additional spatial dimensions varies from 3 to 7. Similarly, lower limits on Λ, the energy scale parameter for the contact interaction, are found to be 12.0 (15.2) TeV for destructive (constructive) interference in the dimuon channel and 13.5 (18.3) TeV in the dielectron channel.