The ratio of branching fractions and the difference in CP asymmetries of the decays B+ → J/ψπ+ and B+ → J/ψK+ are measured using a data sample of pp collisions collected by the LHCb experiment, corresponding to an integrated luminosity of 3 fb−1 at centre-of-mass energies of 7 and 8 TeV. The results are (Formula presented.) where the first uncertainties are statistical and the second are systematic. Combining this result with a recent LHCb measurement of AC P(B+→ J/ ψK+) provides the most precise estimate to date of CP violation in the decay B+ → J/ψπ+, (Formula presented.).