Magnetoencephalography (MEG) encompasses a family of non-contact, non-invasive techniques for detecting the magnetic field generated by the electrical activity of the brain, for analyzing this MEG signal and for using the results to study brain function. The overall purpose of MEG is to extract estimates of the spatiotemporal patterns of electrical activity in the brain from the measured magnetic field outside the head. The electrical activity in the brain is a manifestation of collective neuronal activity and, to a large extent, the currency of brain function. The estimates of brain activity derived from MEG can therefore be used to study mechanisms and processes that support normal brain function in humans and help us understand why, when and how they fail.