the invention concerns a method for producing a gas rich in hydrogen by thermal pyrolysis of hydrocarbons which consists in carrying out , in a reactor a catalyst - free thermal cracking to pyrolyze a fuel selected so as to produce either a gas rich in hydrogen and free of carbon monoxide , or a gas rich in hydrogen and containing carbon monoxide and in using said gas effluents during pyrolysis and inert with respect to the cell as fuel at the burner to heat the reactor so as to bring it to a reaction temperature , and which consists , subsequently , in burning the powder carbon produced in the reactor during the pyrolysis reaction either to produce carbon monoxide or to produce carbon dioxide . the invention is useful in particular for supplying hydrogen to fuel cells and for producing synthesis gas .