A method for shifting gears of a hybrid electric vehicle is provided in the present invention. First, according to the battery SOC, the driver's demand torque and the vehicle state, it is determined that the battery is in a dischargeable state or a chargeable state; secondly, it is determined that in the above two states, a certain The gears that may appear at a vehicle speed, and the engine torque and speed corresponding to each gear; finally, the target gear is determined based on the minimum fuel consumption rate of the engine, and according to the interval between two shifts, determine Whether to perform shift operation. The advantage of this method is that when judging the battery state, by using the comprehensive judgment of the battery SOC, the driver's demand torque and the vehicle state value, the problem of repeated changes in the battery state caused by SOC jumps is avoided. The minimum fuel consumption rate is the condition, and the target gear is determined from all possible gears to ensure the minimum fuel consumption of the vehicle in the target gear; at the same time, it is determined whether to shift gears according to the interval between two gear shifts, avoiding frequent gear shifts.