A method for inserting tops for closing pitted fruit includes the steps of placing a piece of food on a conveyor belt, sliding the piece of food under a viewer, detecting the size and the position of the piece of food, supplying information on the position of the piece of food from the viewer through an electronic circuit to a die-cutting head, die-cutting the piece of food to obtain a segment thereof, cutting the segment into strips, transferring the strips to another conveyor belt, aligning the strips longitudinally on this other conveyor belt, supplying the aligned strips to a drum provided with a plurality of chambers, cutting the strips into closing tops, pitting a fruit in a pitter machine, placing the closing tops into housings in a turning plate, synchronizing the turning of the housings in the turning plate with the turning of the pitter machine, and stuffing one of the closing tops into the mouth of the pitted fruit.