Device for producing and dispensing a customized cosmetic product, said product being produced by mixing at least two cosmetic components housed in a respective container (11, 103), in which • said at least two cosmetic components comprise at least two basic components and at least one, two, three, four, five or even six active components, • at least one of said containers comprises an identification code and said device comprises means for detecting said identification code, • the containers of the basic components comprising an output orifice and are housed in a basic support member, and • said device comprises: • a control means controlling a mixing block and linked to the detection means, which control means is capable of controlling the mixing of said at least two cosmetic components as a function of the identification codes detected, characterized in that in that the device comprises: • a mixing block for mixing the cosmetic components comprising an input orifice, and two cylinders (52, 53) provided with pistons capable of being driven by opposing movements so as to transfer the content of one of the cylinders into the other cylinder, said input orifice in the mixing block being formed in one of said cylinders, • at least one actuator (20, 21) capable of bringing the basic support member into a position in which the output orifice of a determined basic component container is located in sealed tight contact with the input orifice of the mixing block. • said at least two cosmetic components comprise at least two basic components and at least one, two, three, four, five or even six active components, • at least one of said containers comprises an identification code and said device comprises means for detecting said identification code, • the containers of the basic components comprising an output orifice and are housed in a basic support member, and • said device comprises: • a control means controlling a mixing block and linked to the detection means, which control means is capable of controlling the mixing of said at least two cosmetic components as a function of the identification codes detected, characterized in that in that the device comprises: • a mixing block for mixing the cosmetic components comprising an input orifice, and two cylinders (52, 53) provided with pistons capable of being driven by opposing movements so as to transfer the content of one of the cylinders into the other cylinder, said input orifice in the mixing block being formed in one of said cylinders, • at least one actuator (20, 21) capable of bringing the basic support member into a position in which the output orifice of a determined basic component container is located in sealed tight contact with the input orifice of the mixing block. • a control means controlling a mixing block and linked to the detection means, which control means is capable of controlling the mixing of said at least two cosmetic components as a function of the identification codes detected, • a mixing block for mixing the cosmetic components comprising an input orifice, and two cylinders (52, 53) provided with pistons capable of being driven by opposing movements so as to transfer the content of one of the cylinders into the other cylinder, said input orifice in the mixing block being formed in one of said cylinders, • at least one actuator (20, 21) capable of bringing the basic support member into a position in which the output orifice of a determined basic component container is located in sealed tight contact with the input orifice of the mixing block.