A hydrogen generator comprising: a reformer configured to generate a hydrogen-containing gas by using a raw material; a hydro-desulfurizer configured to remove a sulfur compound in the raw material; a recycle passage through which the hydrogen-containing gas is supplied to the raw material before the raw material flows into the hydro-desulfurizer; a booster configured to supply the raw material to the reformer; a raw material supply passage through which the raw material to be supplied to the reformer flows; an ejector which is disposed on the raw material supply passage provided downstream of the booster and upstream of the hydro-desulfurizer and into which the hydrogen-containing gas flows from the recycle passage; characterized by a branch passage that branches from the raw material supply passage extending between the booster and the ejector and merges with the raw material supply passage extending between the ejector and the hydro-desulfurizer; an ordinary temperature desulfurizer disposed on the branch passage and configured to remove the sulfur compound in the raw material; a switching unit configured to switch such that the raw material flows to the ejector or the ordinary temperature desulfurizer; and a controller configured to control the switching unit, wherein: in a case where a flow rate of the raw material is a predetermined threshold or higher, the controller switches such that the raw material flows through the ejector; and in a case where the flow rate of the raw material is lower than the predetermined threshold, the controller switches such that the raw material flows through the ordinary temperature desulfurizer. a reformer configured to generate a hydrogen-containing gas by using a raw material; a hydro-desulfurizer configured to remove a sulfur compound in the raw material; a recycle passage through which the hydrogen-containing gas is supplied to the raw material before the raw material flows into the hydro-desulfurizer; a booster configured to supply the raw material to the reformer; a raw material supply passage through which the raw material to be supplied to the reformer flows; an ejector which is disposed on the raw material supply passage provided downstream of the booster and upstream of the hydro-desulfurizer and into which the hydrogen-containing gas flows from the recycle passage; a branch passage that branches from the raw material supply passage extending between the booster and the ejector and merges with the raw material supply passage extending between the ejector and the hydro-desulfurizer; an ordinary temperature desulfurizer disposed on the branch passage and configured to remove the sulfur compound in the raw material; a switching unit configured to switch such that the raw material flows to the ejector or the ordinary temperature desulfurizer; and a controller configured to control the switching unit, wherein: in a case where a flow rate of the raw material is a predetermined threshold or higher, the controller switches such that the raw material flows through the ejector; and in a case where the flow rate of the raw material is lower than the predetermined threshold, the controller switches such that the raw material flows through the ordinary temperature desulfurizer. in a case where a flow rate of the raw material is a predetermined threshold or higher, the controller switches such that the raw material flows through the ejector; and in a case where the flow rate of the raw material is lower than the predetermined threshold, the controller switches such that the raw material flows through the ordinary temperature desulfurizer.