Abstract The transient electromagnetic (TEM) method has outstanding advantages in detecting depth and response information and can be used to detect anomalies hidden deep inside dams. However, the current data analysis method based on geological exploration is inapplicable to the interpretation of dam detection data, the main reason being the lack of consideration of the influence of dam boundary conditions on the diffusion of the TEM field. In this work, by establishing a numerical model of a dam for TEM detection, the effects of the dam slope ratio, upstream water body, overburden, and other dam boundary conditions on the TEM field were studied. The results showed that the slope ratio made the propagating TEM field to exhibit a constraining behavior, and a negative deviation could be seen in the attenuation curve, indicating a false high-resistance anomaly. The upstream water body distorted the diffusion of the electromagnetic field, and the low-resistance covering layer caused a low-retardation retention phenomenon in the magnetic field, leading to a positive deviation in the attenuation curve, indicating a false low-resistance anomaly. The influence of the boundary conditions was present throughout the entire observation window in which the detection was performed, and the sensitivity of the magnetic field to these boundary conditions was significantly higher than that of the change rate of the magnetic field. With the increase in the observation time, the main influencing factors were the slope ratio, overburden layer, and upstream water body.