We incorporate topography into the 2D resistivity forward solution by using the finite-difference (FD) and finite-element (FE) numerical-solution methods. To achieve this, we develop a new algorithm that solves Poisson's equation using the FE and FD approaches. We simulate topographic effects in the modeling algorithm using three FE approaches and two alternative FD approaches in which the air portion of the mesh is represented by very resistive cells. In both methods, we use rectangular and triangular discretization. Furthermore, we account for topographic effects by distorting the FE mesh with respect to the topography. We compare all methods for accuracy and calculation time on models with varying surface geometry and resistivity distributions. Comparisons show that model responses are similar when high-resistivity values are assigned to the top half of the rectangular cells at the air/earth boundary with the FE and FD methods and when the FE mesh is distorted. This result supports the idea that topographic effects can be incorporated into the forward solution by using the FD method; in some cases, this method also shortens calculation times. Additionally, this study shows that an FD solution with triangular discretization can be used successfully to calculate 2D DC-resistivity forward solutions.