A hydrogen generator comprising: a reformer configured to reform a raw material containing hydrocarbon to generate a reformed gas; a raw material supply unit configured to supply a raw material to the reformer; a combustor configured to combust a combustion gas which is the raw material or the reformed gas, and air, to heat the reformer; an air supply unit configured to supply the air to the combustor; a hydrodesulfurization unit configured to remove a sulfur component from the raw material through a hydrogenation reaction; a heater configured to heat the hydrodesulfurization unit; a desulfurization temperature detector configured to detect a temperature of the hydrodesulfurization unit; a reformed gas passage configured to allow the reformed gas generated by the reformer to flow; a combustion exhaust gas passage configured to allow a combustion exhaust gas generated in the combustor to flow; and a controller, characterized in that a cooling passage configured to allow at least a part of the air supplied from the air supply unit to the combustor flow, through the cooling passage to cool the hydrodesulfurization unit; wherein when the temperature detected by the desulfurization temperature detector is higher than a preset first temperature threshold, the controller is configured to perform control to cause a flow rate of the air supplied to the cooling passage to be higher than the flow rate of the air which is supplied to the cooling passage when the temperature detected by the desulfurization temperature detector is equal to or lower than the first temperature threshold, the heater is constituted by the combustion exhaust gas passage, the reformer or the reformed gas passage. a reformer configured to reform a raw material containing hydrocarbon to generate a reformed gas; a raw material supply unit configured to supply a raw material to the reformer; a combustor configured to combust a combustion gas which is the raw material or the reformed gas, and air, to heat the reformer; an air supply unit configured to supply the air to the combustor; a hydrodesulfurization unit configured to remove a sulfur component from the raw material through a hydrogenation reaction; a heater configured to heat the hydrodesulfurization unit; a desulfurization temperature detector configured to detect a temperature of the hydrodesulfurization unit; a reformed gas passage configured to allow the reformed gas generated by the reformer to flow; a combustion exhaust gas passage configured to allow a combustion exhaust gas generated in the combustor to flow; and a controller, characterized in that a cooling passage configured to allow at least a part of the air supplied from the air supply unit to the combustor flow, through the cooling passage to cool the hydrodesulfurization unit; wherein when the temperature detected by the desulfurization temperature detector is higher than a preset first temperature threshold, the controller is configured to perform control to cause a flow rate of the air supplied to the cooling passage to be higher than the flow rate of the air which is supplied to the cooling passage when the temperature detected by the desulfurization temperature detector is equal to or lower than the first temperature threshold, the heater is constituted by the combustion exhaust gas passage, the reformer or the reformed gas passage.