We numerically study the design of a thermomagnetic generator aimed to convert a heat flow into electrical energy. The device uses the variation of magnetization of a magnetocaloric material (MCM) along a cyclic transformation between the hot and the cold sources. The magnetic energy is transformed into mechanical energy via the magnetic forces and eventually into electrical energy through an electromechanical transducer. Firstly, we work-out the optimal size of the cantilever in order to achieve the self-oscillation of the MCM between the two heat sources. Eventually, using finite element calculations, we compare the efficiency of a piezoelectric transducer (PZT 5a) with that of a set of coils in order to convert the mechanical into electrical energy. The piezoelectrics and the coils recover 0.025% and 0.018% respectively of the available mechanical energy (116 mJ/cm 3). The possible strategies to achieve a better performance are discussed in the conclusion.