We present a search for new massive particles decaying to a pair of top quarks with the CMS detector at the LHC. Proton-proton collision data recorded at a centre-of-mass energy of 13 TeV are used. The search is performed by measuring the invariant mass distribution of the top-quark pair and testing for deviations from the expected Standard Model background. Final states with 0 or 1 leptons are considered and the selection optimized accordingly. In the high mass ranges accessible by the LHC at these energies, the top quarks are produced with high transverse momentum: the products of hadronically decaying top quarks emerge as a single jet, whereas the products of the semileptonic decay mode are characterized by the overlap of the lepton and the b jet. Specific reconstruction algorithm and selections are employed to address the identification of boosted top quark signatures. The results are presented in terms of upper limits on the model cross section. Models of Randall-Sundrum Kaluza-Klein gluon production as well as narrow, wide, and extra wide Z’ boson models are considered.