Single-photon avalanche diodes (SPADs) are nowadays the most consolidate solid-state alternative to photomultiplier tubes and time-correlated single-photon counting. Optical benches are used for the characterization of the noise figures of these detectors, including dark count, afterpulsing effects and cross-talk. With accurate optical setups it is possible to obtain resolutions down to 5 microns, but with today's technologies, this spot size can cover more than one single pixel. Moreover, on other common and envisaged applications like particle detection in Nuclear and High Energy Physics or as silicon photomultipliers for Cerenkov telescopes, this does not allow to observe what happens when a charge is generated between consecutive pixels. This work presents the innovative characterization of single-photon detectors with the aid of the electron beam generated in a dual beam FIB/SEM apparatus. A simple setup allows a very good control of the dose and the spot down to 5 nm at 30 keV, The characterization has been proven in photodetectors fabricated in a standard CMOS technology. The results have been validated by comparison with those obtained by optical setups, with simulation with PENELOPE (Penetration and Energy Loss of Positrons and Electrons) and by technology simulations with ISE-tCAD.