Results are reported from a search for the pair production of top squarks, the supersymmetric partners of top quarks, in final states with jets and missing transverse momentum. The data sample used in this search was collected by the CMS detector and corresponds to an integrated luminosity of 18.9fb-1 of proton-proton collisions at a centre-of-mass energy of 8TeV produced by the LHC. The search features novel background suppression and prediction methods, including a dedicated top quark pair reconstruction algorithm. The data are found to be in agreement with the predicted backgrounds. Exclusion limits are set in simplified supersymmetry models with the top squark decaying to jets and an undetected neutralino, either through a top quark or through a bottom quark and chargino. Models with the top squark decaying via a top quark are excluded for top squark masses up to 755GeV in the case of neutralino masses below 200GeV. For decays via a chargino, top squark masses up to 620GeV are excluded, depending on the masses of the chargino and neutralino.