We determined that the electromagnetic vertical transverse isotropic response in a layered earth can be obtained by solving two equivalent scalar equations, which were for the vertical electric field and for the vertical magnetic field, involving only a scalar global reflection coefficient. Besides the complete derivation of the full electromagnetic response, we also developed the corresponding computer code called EMmod, which models the full electromagnetic fields including internal multiples in the frequency-wavenumber domain and obtains the frequency-space domain solutions through a Hankel transformation by computing the Hankel integral using a 61-point Gauss-Kronrod integration routine. The code is able to model the 3D electromagnetic field in a 1D earth for diffusive methods such as controlled source electromagnetics as well as for wave methods such as ground penetrating radar. The user has complete freedom to place the source and the receivers in any layer. The modeling is illustrated with three examples, which aim to present the different capabilities of EMmod, while assessing its correctness.