A schematic of a “lab-on-a-chip” device integrating particle synthesis, particle characterization, magnetic labeling, and particle sorting sections on a single chip. In this design, the magnetic nanoparticles are synthesized and enter into the characterization section (yellow area). Based on the signal of the magnetometer a feedback signal is sent to the input controllers to tune the magnetic nanoparticle characteristics. Then, after removing the improper nanoparticles, the synthesized magnetic nanoparticles are used to label the cells in an incubation chamber (green area). Next, the magnetically labeled cells are sorted on-chip (blue area) for biological studies.