Rare earth–based nanomaterials that have abundant optical, magnetic, and catalytic characteristics have many applications. The controllable introduction of mesoporous channels can further enhance its performance, such as exposing more active sites of rare earth and improving the loading capacity, yet remains a challenge. Here, we report a universal viscosity-mediated assembly strategy and successfully endowed rare earth–based nanoparticles with central divergent dendritic mesopores. More than 40 kinds of dendritic mesoporous rare earth–based (DM-REX) nanoparticles with desired composition (single or multiple rare earth elements, high-entropy compounds, etc.), particle diameter (80 to 500 nanometers), pore size (3 to 20 nanometers), phase (amorphous hydroxides, crystalline oxides, and fluorides), and architecture were synthesized. Theoretically, a DM-REX nanoparticle library with 393,213 kinds of possible combinations can be constructed on the basis of this versatile method, which provides a very broad platform for the application of rare earth–based nanomaterials with rational designed functions and structures.