A numerical technique for solving three-dimensional liquid metal MHD problems has been developed as a design tool for fusion reactor blankets. The present code can analyze the flow in a rectangular duct under a strong transverse magnetic field except for the case when the field lines are parallel to the walls. Only the flow in the core region is calculated with the inertialess inviscid fluid assumption, since thin boundary and shear layers do not affect the core flow. There are algebraic relations in the field directional distributions of the current and the potential. Considering the relations, the perpendicular distributions to the field were calculated in the fluid with a two-dimensional finite difference model simultaneously with those in the walls. Thus the three-dimensional problem is solved by the two-dimensional code. The calculation of the current and potential distributions is started with an assumed velocity distribution. The result does not always satisfy all the governing equations. The velocity is redistributed until the solution satisfies all the governing equations. The effect of field non-uniformity was analyzed by the code as an example.