In the planning of epilepsy surgery procedures, intracranial electrodes are implanted in a significant fraction of the patients. Accurate localization of the individual electrode contacts with respect to the brain cortex is imperative. Because the manual tracking of an EEG electrode in a CT scan in a slice-by-slice fashion is cumbersome and subjective, the goal of this study was to develop an easier and more accurate way to localize implanted EEG electrodes. In this paper, we present our solution in the form of a virtual-reality environment with interactive tools to assist the clinician with EEG localization. With the help of a high-quality and fast volume renderer, a view is created of the inside of the patient's skull to obtain an overview of the electrodes in relation to the cortical structures. Depth, grid, and reed electrodes are characterized semi-interactively using different methods. For depth electrodes, the contacts (which are not visible in the CT scan) are derived by measuring off the theoretical distance between the contact and the end of the electrode from the central axis produced by a three-dimensional (3D) line tracker. For grid electrodes, the contacts are visible in a CT, so the 3D view is merely used to find the contacts and to resolve the overlap of grids with other grids, tail wires, or bone ridges. For reed electrodes, the contacts, which are again not visible in this case, are calculated from a line model fitted to the positions of lead markers. After letting the user place artificial spheres on the lead markers and wire, a B-spline is fitted to the spheres' centers to estimate the positions of the contacts. The approach was evaluated by applying it to CT scans of seven patients. It appeared that the method is generally applicable (even crossing electrodes or electrodes with gaps were correctly characterized), and that the display via 3D views and slices is so good that manual placement of spheres performed as well as semi-automatic placement. From computer experiments, it appeared that the final localization error in the position of EEG contacts could be estimated to lie in the order of the dimensions of one voxel.