Abstract: A device for the automatic ejection of a capsule or pellet in a machine for the production of hot beverages or coffee, where the machine comprises a movable part (13), moved by an actuator (14), and a fixed part (15), realising an infusion chamber (20) where the capsule or pellet (16) is placed, an extractor element (28) being foreseen, in the device the extractor element (28) being associated with a sliding element (21), provided at an upper end with an ejection plate (30) shaped to be arranged, in rest position, partially around the seat (20), transversally to the movement between the fixed part and the movable part, the sliding element (21) being movable through axial and rotation movement seat (20), the axial and rotation movement between a rest position and a raised position in which the rotating plate (30) removes a capsule placed in the determined by elements of mutual engagement (18, 19; 29), one arranged on the movable part (13) and the other on the sliding element (21), which may be disengaged in th