The finite-element method can be used to solve the differential equations which describe electrical and electromagnetic (EM) field behavior. The equations are, respectively, Poisson's equation and the vector, damped wave equation. The finite-element equations are derived, in both cases, using the minimum theorem. While both tetrahedral and hexahedral elements may be used for the modeling of the resistivity problem, only hexahedral elements give satisfactory results for the EM problem. A disadvantage of the relatively simple mesh design used in the approach described here is the presence of long thin elements. Such elements have very poor interpolating properties, and they adversely affect the rate of convergence of the overrelaxation technique used in solving the resulting system of linear equations.For the modeling of resistivity data over an earth with one plane of symmetry, the system of equations typically has about 9000 unknowns. About 50,000 unknowns are needed to give a satisfactory solution to an EM problem where the earth has one plane of symmetry. The advantage of solving these problems with a technique such as the finite-element method is that earths with an almost arbitrary distribution of conductivity can be modeled. On the other hand, an integral-equation method can be far more cost effective for small inhomogeneities. The results from the resistivity algorithm show the adverse effect of an irregular, conducting, and polarizable overburden on dipole-dipole, induced polarization surveys. Modeling of a horizontal loop EM survey illustrates the importance of assessing the host rock conductivity before attempting to interpret inhomogeneity responses.