A search is presented for excited quarks of light and heavy flavor that decay to gamma + jet final states. The analysis is based on data corresponding to an integrated luminosity of 35.9 fb(-1) collected by the CMS experiment in proton-proton collisions at root s = 13 TeV at the LHC. A signal would appear as a resonant contribution to the invariant mass spectrum of the gamma + jet system, above the background expected from standard model processes. No resonant excess is found, and upper limits are set on the product of the excited quark cross section and its branching fraction as a function of its mass. These are the most stringent limits to date in the gamma + jet final state, and exclude excited light quarks with masses below 5.5 TeV and excited b quarks with masses below 1.8 TeV, assuming standard model like coupling strengths. (C) 2018 The Author(s). Published by Elsevier B.V.