A novel magnetic field sensor is proposed based on the combination of in-line tapered photonic crystal fibre (PCF) Mach–Zehnder interferometer and magnetic nanoparticles. The sensor is theoretically investigated and experimentally realized. The effect of the mechanical strain and the magnetic field on the sensitivity of the sensor is studied. It is found that the proposed sensor shows a wavelength-sensitivity of $$-\,0.072\,\text {nm/mT}$$
-
0.072
nm/mT
and a strain-sensitivity of $$1\,\text {pm/}\upmu \,\epsilon \,$$
1
pm/
μ
ϵ
. To evaluate the effect of the magnetic nanoparticles on the output light intensity, the sensitivity response of the device has been measured under different magnetic field strengths for different length scales. The experimental results show refractive index changes of the magnetic nanoparticles-infiltrated PCF—acting as fibre cladding—under the applied magnetic field leads to variations of the interferometric output. The sensitivity of magnetic field measurement with the sensor with $$30\,\text {mm}$$
30
mm
and $$40\,\text {mm}$$
40
mm
PCF could reach up to $$0.021\,\text {dB/mT}$$
0.021
dB/mT
and $$0.017\,\text {dB/mT}$$
0.017
dB/mT
, respectively. The results show a very good linear response that is an essential requirement for the practical sensors. The proposed magnetic field sensor finds applications in various areas, such as optical sensing, military, power industry, and tunable photonic devices.