In-plane diffractive optical networks based on meta-surfaces are promising for on-chip application. The design constraints of regular antenna unit place ultimate limits on the functionalities of the meta-systems. This fundamental limitation has been reflected by the large footprints of cascaded meta-surfaces. Here, we propose a digital meta-lens with a large degree of design freedom, enabling significantly improved beam focusing, collimation, and deflection capabilities. A highly dispersive and compact diffractive optical system is constructed for spectrometer via five layers of meta-lenses in a folded configuration. The device only occupies a 100 μm × 100 μm chip area on a silicon photonic platform. Sparse and continuous spectra reconstruction is achieved over a 35 nm bandwidth. Fine spectral lines separated by 0.14 nm are resolved. In addition to such a compact and high-resolution on-chip spectrometer, it is also expected to be promising for imaging, optical computing, and other applications due to the great versatility of the digital lens design.