Results are presented of a search for the production of new particles decaying to pairs of partons (quarks, antiquarks, or gluons), in the dijet mass spectrum in proton-proton collisions at √s=8 TeV. The data sample corresponds to an integrated luminosity of 4.0 fb−1, collected with the CMS detector at the LHC in 2012. No significant evidence for narrow resonance production is observed. Upper limits are set at the 95% confidence level on the production cross section of hypothetical new particles decaying to quark-quark, quark-gluon, or gluon-gluon final states. These limits are then translated into lower limits on the masses of new resonances in specific scenarios of physics beyond the standard model. The limits reach up to 4.8 TeV, depending on the model, and extend previous exclusions from similar searches performed at lower collision energies. For the first time mass limits are set for the Randall–Sundrum graviton model in the dijet channel.