A machine for putting lids on boxes comprising a supply area that incorporates a conveyor track, a working area that incorporates at least one gluing device and an exit area that incorporates another conveyor track, wherein: - the supply area further comprises: - at least one mechanism with elevators, - brakes, - the working area further comprises: - at least one device for putting on lids comprising a vertical actuation mechanism connected to a cross-shaped end that incorporates a folding device with an actuator on each of the arms and two tracks on respective opposite arms, - a lid-positioning device configured to move a lid and position it on the tracks of the device for putting on lids, so that: - the gluing devices are configured to apply glue on at least one element to be selected between a box, a lid and both, - the mechanisms with elevators and the brakes are configured to act on the boxes during a certain time, so that the boxes are immobilized, creating a pause in the supply of boxes to the working area, - the folding devices have the capacity to be positioned along the respective arms of the cross-shaped end, so that they are valid for different lid sizes, - the folding devices are configured, once the vertical actuation mechanism is unfolded, to fold flaps of a lid on a box and maintain the pressure during a certain time, - the rotating movement of the folding devices for folding the flaps is activated upon exerting pressure on the actuators, the machine being characterized in that the supply area further comprises a station for reading dimensions and also in that the machine comprises two devices for putting on lids capable of moving along tracks parallel to the conveyor track through the working area and configured to act simultaneously on the lids, wherein: the devices for putting on lids are located in positions facing each other with respect to the longitudinal shaft of the conveyor track and they are configured to be displaced with the vertical actuation mechanism in the unfolded position, exerting pressure on the lid of a box in one direction, and in the folded position in the return direction, so that they do not interfere with each other. - the supply area further comprises: - at least one mechanism with elevators, - brakes, - at least one mechanism with elevators, - brakes, - the working area further comprises: - at least one device for putting on lids comprising a vertical actuation mechanism connected to a cross-shaped end that incorporates a folding device with an actuator on each of the arms and two tracks on respective opposite arms, - a lid-positioning device configured to move a lid and position it on the tracks of the device for putting on lids, - at least one device for putting on lids comprising a vertical actuation mechanism connected to a cross-shaped end that incorporates a folding device with an actuator on each of the arms and two tracks on respective opposite arms, - a lid-positioning device configured to move a lid and position it on the tracks of the device for putting on lids, - the gluing devices are configured to apply glue on at least one element to be selected between a box, a lid and both, - the mechanisms with elevators and the brakes are configured to act on the boxes during a certain time, so that the boxes are immobilized, creating a pause in the supply of boxes to the working area, - the folding devices have the capacity to be positioned along the respective arms of the cross-shaped end, so that they are valid for different lid sizes, - the folding devices are configured, once the vertical actuation mechanism is unfolded, to fold flaps of a lid on a box and maintain the pressure during a certain time, - the rotating movement of the folding devices for folding the flaps is activated upon exerting pressure on the actuators,