Magnetic nanosensors function based on the principles of magnetoresistance, magnetic resonance, or magnetic particle detection. For instance, in a magnetoresistive sensor, the resistance of the sensor material changes in response to an external magnetic field, which can be measured and correlated with the quantity of interest. Alternatively, magnetic nanoparticles can be used to label target molecules, and their presence can be detected by their magnetic properties.