The invention relates to the field of smart homes, in particular to a door with an anti-pinch device. The door comprises a door frame and a door leaf, the door leaf is hinged to the door frame througha hinge, the door further comprises two sets of infrared pair pipe sensors, an electric push rod, a microcontroller and a buzzer, each infrared pair pipe sensor comprises an infrared ray transmittingpipe and an infrared ray receiving pipe, one set of infrared pair pipe sensors are installed on the top and the bottom of the door frame and on the door leaf fixing side, the other set of infrared pair pipe sensors are installed on the top and the bottom of the door frame and on the door closing side, and the infrared pair pipe sensors, the buzzer, the electric push rod and the microcontroller are connected. By means of the door, child fingers in a door seam can be quickly recognized, in-time alarming is achieved, the fingers are stopped between the door leaf and the door frame, door closingis prevented, and the safety and the practicability of the door are greatly improved.