A search for charged Higgs bosons in decays of is presented both with mass larger than the top quark in the production process, and lighter than the top quark in the channel. The fully hadronic final state is considered. The search is performed using the 2016 data collected by CMS at \sqrt{s}=13~\mathrm{TeV}, and that correspond to a total integrated luminosity of 12.9~\text{fb}^{\scriptscriptstyle -1}. The observation agrees with the standard model prediction. Limits on the charged Higgs boson cross section times branching fraction are set for the mass range of 180~\mathrm{GeV} < m_{\mathrm{H}^{\pm}} < 3~\mathrm{TeV}, while limits on the branching fraction of top quark to charged Higgs boson are set in the mass range of 80 to 160~\text{GeV}, and results are interpreted in the context of two-Higgs-doublet models.