Abstract: An automatic machine for packaging products, in particular cosmetic or pharmaceutical products, inside containers (11), comprising a series of stations (15-21, 21A, 21B, 21C, 23-28), in each of which the operations required to insert the products and their leaflets into containers or cartons (11), and to close the cartons (11) definitively are performed; with the machine the format of the container (11) can be changed in extremely short times and automatically, by using a keyboard to key in the parameters relevant to the dimensions of the sides (A, B, C) of the carton (11) utilised.