The smallest-pore SAPO-20 zeolite confined pyrolysis of organics afforded ultrasmall uniform carbon dots with excellent performance in bioimaging.