SUMMARY We developed a 3-D forward modelling code, which simulates controlled source electromagnetic problems in frequency domain using edge-based finite elements and a total electric field approach. To evaluate electromagnetic data acquired across complex subsurface structures, software performing accurate 3-D modelling is required, especially for incorporation in inversion approaches. Our modelling code aims at finding a good compromise between the necessary solution accuracy at the points of interest and the general problem size by using a goal-oriented mesh refinement strategy designed for models of variable electric conductivity and magnetic permeability. To formulate an improved error estimator suitable for controlled source electromagnetic problems, we developed literature approaches of mesh refinement further targeting three aspects. First, to generate a roughly homogeneously fine mesh discretization around all receiver sites, our new error estimator weights the adjoint source term by the approximate decay of the electric field with increasing distance from the primal source using the expression for a homogeneous half-space. This causes almost no additional computational cost. Second, the error estimator employed in the refinement approach can be optimized for models with pronounced conductivity and magnetic permeability contrasts as often encountered in, for example, mineral prospecting scenarios by optionally including terms that measure the continuity of the normal component of current flow and the tangential component of the magnetic field across interfaces of abutting elements. Third, to avoid amplitude-dependent over-refining of the mesh, we formulate our element-wise error estimators relative to the local amplitude of the electromagnetic field. In this work, we evaluate the implemented adaptive mesh refinement approach and its solution accuracy comparing our solutions for simple 1-D models and a model with 3-D anomalies to semi-analytic 1-D solutions and a second-order finite-element code, respectively. Furthermore, a feasibility study for controlled-source electromagnetic measurements across ferrous mineral deposits is conducted. The numerical experiments demonstrate that our new refinement procedure generates problem-specific finite-element meshes and yields accurate solutions for both simple synthetic models and realistic survey scenarios. Especially for the latter, characteristics of our code, such as the possibility of modelling extended sources as well as including arbitrary receiver distributions and detailed subsurface anomalies, are beneficial.