The three-dimensional ( 3D ) coordinates of stereoscopically triangulated loops provide strong constraints for magnetic field models of active regions in the solar corona . Here we use STEREO/A and B data from some 500 stereoscopically triangulated loops observed in four active regions ( 2007 Apr 30 , May 9 , May 19 , Dec 11 ) , together with SOHO/MDI line-of-sight magnetograms . We measure the average misalignment angle between the stereoscopic loops and theoretical magnetic field models , finding a mismatch of \mu = 19 ^ { \circ } -46 ^ { \circ } for a potential field model , which is reduced to \mu = 14 ^ { \circ } -19 ^ { \circ } for a non-potential field model parameterized by twist parameters . The residual error is commensurable with stereoscopic measurement errors ( \mu _ { SE } \approx 8 ^ { \circ } -12 ^ { \circ } ) . We developed a potential field code that deconvolves a line-of-sight magnetogram into three magnetic field components ( B _ { x } ,B _ { y } ,B _ { z } ) , as well as a non-potential field forward-fitting code that determines the full length of twisted loops ( L \approx 50 - 300 Mm ) , the number of twist turns ( median N _ { twist } = 0.06 ) , the nonlinear force-free \alpha -parameter ( median \alpha \approx 4 \times 10 ^ { -11 } cm ^ { -1 } ) , and the current density ( median j _ { z } \approx 1500 Mx cm ^ { -2 } s ^ { -1 } ) . All twisted loops are found to be far below the critical value for kink instability , and Joule dissipation of their currents is found be be far below the coronal heating requirement . The algorithm developed here , based on an analytical solution of nonlinear force-free fields that is accurate to second order ( in the force-free parameter \alpha ) , represents the first code that enables fast forward-fitting to photospheric magnetograms and stereoscopically triangulated loops in the solar corona .