The algorithm and program of forwarding and inversion of magnetotelluric (MT) is proposed and verified in this study. This provides the geophysical interpretation for borehole-to-surface MT and controlled source audio MT (CSAMT) and makes the method more complete and effective. Based on the deduced nonlinear conjugate gradients (NLCG) algorithm by Rodi (2001), borehole-to-Surface MT 2-D NLCG inversion algorithm was deduced, inversion code was adopted, and 2-D NLCG inversion program were developed, and finally validity of the inversion program has been tested. It was found through comparison of forward and inversion modeling at various stations that noise can be suppressed with survey stations underground and then resolution ability of inversion can be enhanced.