FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being developed by a team of researchers at the Donders Institute for Brain, Cognition and Behaviour in Nijmegen, the Netherlands in close collaboration with collaborating institutes. The development of FieldTrip currently receives support from the ChildBrain project and from the Netherlands Organization for Scientific Research (NWO) and has previously been supported by the Human Connectome project and BrainGain. The toolbox offers advanced analysis methods of MEG, EEG, and invasive electrophysiological data, such as time-frequency analysis, source reconstruction using dipoles, distributed sources and beamformers and non-parametric statistical testing. It supports the data formats of all major MEG systems (CTF, Elekta/Neuromag, 4D, Yokogawa) and of most popular EEG systems, and new formats can be added easily. FieldTrip contains high-level functions that you can use to construct your own analysis protocols in MATLAB. Furthermore, it easily allows developers to incorporate low-level algorithms for new EEG/MEG analysis methods.