Janus particles with features of an anisotropic photonic band gap (PBG) structure and magnetic property have been achieved by phase separation and self-assembly of nanoparticles in microfluidic droplets. The resultant particles enable optical encoding and magnetically controllable motion, making them excellent functional encoded particles in biomedical applications.