The polarizations of prompt J/ψ and ψ(2S) mesons are measured in proton–proton collisions at √s = 7TeV, using a dimuon data sample collected by the CMS experiment at the LHC, corresponding to an integrated luminosity of 4.9 fb^(−1). The prompt J/ψ and ψ(2S) polarization parameters λ_ϑ, λ_φ, and λ_(ϑφ), as well as the frame-invariant quantity √s = 7TeV, are measured from the dimuon decay angular distributions in three different polarization frames. The J/ψ results are obtained in the transverse momentum range 14<p_T<70 GeV, in the rapidity intervals |y|<0.6 and 0.6<|y|<1.2. The corresponding ψ(2S) results cover 14<p_T<50 GeV and include a third rapidity bin, 1.2<|y|<1.5. No evidence of large polarizations is seen in these kinematic regions, which extend much beyond those previously explored.