To effectively overcome the weak consistency of single inversion of magnetotelluric (or teleseismic travel time data), and also to solve the limitations' of petrophysical approach, we study a three-dimensional joint inversion algorithm of magnetotelluric and seismic travel time data with cross-gradient constraints. Based on well-developed three-dimensional teleseismic and magnetotelluric forward and inversion algorithms, a three-dimensional joint inversion algorithm having common inversion grids, with cross-gradient as structural constraint, and with both resistivity and velocity models able to be simultaneously obtained has been achieved. With synthetic data from a single-prism model and two double-prism models, trial computation of joint inversion has been carried out, and the results indicate that, compared with single inversion, joint inversion has better effect in recovering both single prism' s and double-prism' s spatial morphology. The resistivity value of the single-prism is much closer to the true model in joint inversion, while by double-prism models, joint inversion not only removes false resistivity anomaly of wall rock to a certain degree, but also has large improvement on increasing the resolution of P-wave deep structure of anomalous body. Moreover, joint inversion improve the separate inversion results when resistivity and velocity is incompatible, indicating the cross-gradient is not be restricted on the relationship of different petrophysical parameters, focuses on structural similarity and thus has wide applicability. but rather focuses on structural similarity and thus has wide applicability.