Metal nanoparticles are frequently employed for the colorimetric detection of specific target molecules using an aggregation-induced shift of the localized surface plasmon resonance. However, metal nanoparticles dispersed in bulk solutions are prone to be contaminated by adhesive molecules and the dispersions tend to be diluted by sample fluids, restricting direct application to unpurified pristine samples. Here, a versatile capsule sensor platform is proposed that can encompass a variety of different types of nanoparticle-based sensors. The capsule sensors are microfluidically prepared to obtain close control over their dimensions and composition. Their aqueous cores that are loaded with sensing materials are surrounded by an ultrathin inner oil shell and an outer hydrogel shell. The hydrogel shell prevents the diffusion of large adhesive molecules into the core, thereby preventing contamination of the sensing materials. The oil shell is selectively permeable such that it further improves the sensor selectivity. Importantly, these shells confine the sensing materials and prevent them from being diluted, securing a consistent optical property. Moreover, the capsule-based sensors display a higher sensitivity than bulk dispersions because a smaller amount of sensing materials is used. The power of nanoparticle-loaded capsule sensors is demonstrated using lysine-coated gold nanoparticles to detect mercury ions.