This paper introduces a Neuroelectromagnetic Forward Modeling Toolbox running under MATLAB (The Mathworks, Inc.) for generating realistic head models from available data (MRI and/or electrode locations) and for solving the forward problem of electro-magnetic source imaging numerically. The toolbox includes tools for segmenting scalp, skull, cerebrospinal fluid (CSF) and brain tissues from T1-weighted magnetic resonance (MR) images. After extracting the segmented tissue volumes, mesh generation can be performed using deformable models. When MR images are not available, it is possible to warp a template head model to measured electrode locations to obtain a better-fitting realistic model. The Boundary Element Method (BEM) is used for the numerical solution of the forward problem. Toolbox functions can be called from either a graphic user interface or from the command line. Function help messages and a tutorial are included. The toolbox is freely available under the GNU Public License for noncommercial use and open source development.