Magnetic field detection with extremely high spatial resolution is crucial to applications in magnetic storage, biosensing, and magnetic imaging. Here, we present the concept of using a spin torque oscillator (STO) to detect magnetic fields by measuring the frequency of the oscillator. This sensor's performance relies predominantly on STO properties such as spectral linewidth and frequency dispersion with magnetic field, rather than signal amplitude as in conventional magnetoresistive sensors, and is shown in measured devices to achieve large signal to noise ratios. Using macrospin simulations, we describe oscillator designs for maximizing performance, making spin torque oscillators an attractive candidate to replace more commonly used sensors in nanoscale magnetic field sensing and future magnetic recording applications.