  The correlation between net baryon number and electric charge,
$\chi_{11}^{\rm BQ}$, can serve as a magnetometer of QCD. This is demonstrated
by lattice QCD computations using the highly improved staggered quarks with
physical pion mass of $M_\pi=135~$MeV on $N_\tau=8$ and 12 lattices. We find
that $\chi_{11}^{\rm BQ}$ along the transition line starts to increase rapidly
with magnetic field strength $eB\gtrsim 2M_\pi^2$ and by a factor 2 at
$eB\simeq 8M_\pi^2$. Furthermore, the ratio of electric charge chemical
potential to baryon chemical potential, $\mu_{\rm Q}/\mu_{\rm B}$, shows
significant dependence on the magnetic field strength and varies from the ratio
of electric charge to baryon number in the colliding nuclei in heavy ion
collisions. These results can provide baselines for effective theory and model
studies, and both $\chi_{11}^{\rm BQ}$ and $\mu_{\rm Q}/\mu_{\rm B}$ could be
useful probes for the detection of magnetic fields in relativistic heavy ion
collision experiments as compared with corresponding results from the hadron
resonance gas model.
