A formal series transformation to Birkhoff-Gustavson normal form is obtained for toroidal magnetic field configurations in the neighborhood of a magnetic axis. Bishops rotation-minimizing coordinates are used to obtain a local orthogonal frame near the axis in which the metric is diagonal, even if the curvature has zeros. We treat the cases of vacuum and force-free (Beltrami) fields in a unified way, noting that the vector potential is essentially the Poincare-Liouville one-form of Hamiltonian dynamics, and the resulting magnetic field corresponds to the canonical two-form of a nonautonomous one-degree-of-freedom system. Canonical coordinates are obtained and Floquet theory is used to transform to a frame in which the lowest-order Hamiltonian is autonomous. The resulting magnetic axis can be elliptic or hyperbolic, and resonant elliptic cases are treated. The resulting expansion for the field is shown to be well-defined to all orders, and is explicitly computed to degree four. An example is given for an axis with constant torsion near a 1:3 resonance.