Nuclear magnetic resonance (NMR) is a paramount analytical tool for chemistry, biology, medicine, and geology, and has a fundamental importance in physics. The recent years have seen a wealth of efforts to miniaturize NMR systems by combining permanent magnets and CMOS radio frequency (RF)-integrated circuits (ICs) to make the benefit of NMR more broadly available beyond dedicated facilities, which have resulted in systems capable of NMR relaxometry first, and later NMR spectroscopy, the two key NMR modalities. Here we report a small NMR system comprising a digitally assisted CMOS RF transceiver IC and a 0.51-T permanent magnet, which not only enhances spectroscopy and relaxometry performance but also includes magnetic resonance imaging (MRI), a powerful variant of relaxometry. The system achieves a spectral resolution of <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$<$</tex-math> </inline-formula> 0.05 ppm (1.1 Hz), the highest reported in a portable CMOS-based NMR system, and an imaging resolution of <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$67\times 67$</tex-math> </inline-formula> <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$\times$</tex-math> </inline-formula> 83 <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$\bm{\mu}$</tex-math> </inline-formula> m <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$^3$</tex-math> </inline-formula> .