The invention discloses a sorting device which comprises a guide rail and a material vehicle moving on the guide rail. A plurality of sorting openings are formed in the two sides of the guide rail, and at least one electromagnet is arranged at the position, corresponding to the sorting openings, of the guide rail. The material vehicle comprises a frame, a material tray, at least one magnet and at least two elastic telescopic pieces. The frame is used for bearing the material tray, and the material tray comprises a material loading surface, is used for loading materials and is rotationally connected with the frame. The magnet is arranged on one surface, opposite to the material loading surface, of the material tray, and is connected with the electromagnet in an adsorbing mode so as to realize the switch of the material vehicle between the transport state and the unloading state. The elastic telescopic pieces are connected with the frame and the material tray and are used for maintaining the transport state or realizing material tray resetting after the unloading state. By the implementation mode, the rollover or resetting of the material tray is realized by using magnetic force, the material tray resetting is realized by using the elastic telescopic pieces, meanwhile the material stray keeps balance, and thus the material tray is easier to reset and is difficult to roll over.