The solar neighbourhood is populated by nearby (<200pc), young (<100Myr) moving groups (NYMGs) of stars, whose origins are still debated. A possible explanation is that they are remnants of individual stellar clusters and associations, currently dispersing in the Galactic disc. We aim to derive the initial mass function (IMF) of a large sample of NYMGs. We developed and applied an algorithm that uses photometric and astrometric data from Gaia DR3 to detect NYMGs as over-densities in a kinematic space, whose members distribute along young isochrones. We inferred individual masses from the photometry of both the detected and the previously known candidates. We estimated the IMFs for 33 groups, 30 of them for the first time, in an average mass range 0.1