A top quark mass measurement is performed using 35.9fb-1 of LHC proton–proton collision data collected with the CMS detector at s=13TeV. The measurement uses the t t ¯ all-jets final state. A kinematic fit is performed to reconstruct the decay of the t t ¯ system and suppress the multijet background. Using the ideogram method, the top quark mass (m t ) is determined, simultaneously constraining an additional jet energy scale factor (JSF). The resulting value of mt=172.34±0.20(stat+JSF)±0.70(syst)GeV is in good agreement with previous measurements. In addition, a combined measurement that uses the t t ¯ lepton+jets and all-jets final states is presented, using the same mass extraction method, and provides an m t measurement of 172.26±0.07(stat+JSF)±0.61(syst)GeV. This is the first combined m t extraction from the lepton+jets and all-jets channels through a single likelihood function.