AbstractElectroencephalography (EEG) and magnetoencephalography (MEG) are among the most important techniques for non-invasively studying cognition and disease in the human brain. These signals are known to originate from cortical neural activity, typically described in terms of current dipoles. While the link between cortical current dipoles and EEG/MEG signals is relatively well understood, surprisingly little is known about the link between different kinds of neural activity and the current dipoles themselves. Detailed biophysical modeling has played an important role in exploring the neural origin of intracranial electric signals, like extracellular spikes and local field potentials. However, this approach has not yet been taken full advantage of in the context of exploring the neural origin of the cortical current dipoles that are causing EEG/MEG signals.Here, we present a method for reducing arbitrary simulated neural activity to single current dipoles. We find that the method is applicable for calculating extracranial signals, but less suited for calculating intracranial electrocorticography (ECoG) signals. We demonstrate that this approach can serve as a powerful tool for investigating the neural origin of EEG/MEG signals. This is done through example studies of the single-neuron EEG contribution, the putative EEG contribution from calcium spikes, and from calculating EEG signals from large-scale neural network simulations. We also demonstrate how the simulated current dipoles can be used directly in combination with detailed head models, allowing for simulated EEG signals with an unprecedented level of biophysical details.In conclusion, this paper presents a framework for biophysically detailed modeling of EEG and MEG signals, which can be used to better our understanding of non-inasively measured neural activity in humans.Graphical abstractHighlightsCurrent dipoles are computed from biophysically detailed simulated neuron and network activityExtracted current dipoles allow for accurate computation of EEG and MEG signals in simplified and detailed head modelsCurrent-diplole approximation generally not suitable for accurate calculations of ECoG signalsMethod provides biophysics-based link between detailed neural activity and systems-level signals