We introduce a framework for the preparation, coherent manipulation and characterization of free-electron quantum states, experimentally demonstrating attosecond pulse trains for electron microscopy. Specifically, we employ phaselocked single-color and two-color optical fields to coherently control the electron wave function along the beam direction. We establish a new variant of quantum state tomography -"SQUIRRELS" -to reconstruct the density matrices of freeelectron ensembles and their attosecond temporal structure. The ability to tailor and quantitatively map electron quantum states will promote the nanoscale study of electron-matter entanglement and the development of new forms of ultrafast electron microscopy and spectroscopy down to the attosecond regime.Optical, electron and x-ray microscopy and spectroscopy reveal specimen properties via spatial and spectral signatures imprinted onto a beam of radiation or electrons. Leaving behind the traditional paradigm of idealized, simple probe beams, advanced optical techniques increasingly harness tailored probes, or even their quantum properties and probe-sample entanglement. The rise of structured illumination microscopy 1 , pulse shaping 2 , and multidimensional 3 and quantum-optical spectroscopy 4 exemplify this development. Similarly, electron microscopy explores the use of shaped electron beams exhibiting particular spatial symmetries 5 or angular momentum 6,7 , and novel measurement schemes involving quantum aspects of electron probes have been proposed 8,9 . Ultrafast imaging and spectroscopy with electrons and x-rays are the basis for an ongoing revolution in the understanding of dynamical processes in matter on atomic scales [10][11][12][13] . The underlying technology heavily rests on laser science for the 2 generation and characterization of ever-shorter femtosecond electron 10,14 and xray [15][16][17] probe pulses, with examples in optical pulse compression 18 and streaking spectroscopy [19][20][21] . The temporal structuring of electron probe beams is facilitated by time-dependent fields in the radio-frequency [22][23][24] , terahertz 18,25 or optical domains. Promising a further leap in temporal resolution, recent findings suggest that ultrafast electron diffraction and microscopy with optically phasecontrolled and sub-cycle, attosecond-structured wave functions may be feasible 8,[26][27][28][29][30] . Specifically, light-field control may translate the temporal resolution of ultrafast transmission electron microscopy (UTEM) 31,32 and electron diffraction (UED) 10,33 , currently at about 200 fs 34 and 20 fs 14,23 , respectively, to the range of attoseconds 26,27,35 . However, such future technologies call for means to both prepare and fully analyze the corresponding quantum states of free electrons.Here, we demonstrate the coherent control and attosecond density modulation of free-electron quantum states using multiple phase-locked optical interactions. Moreover, we introduce quantum state tomography for free electrons, providing crucial e...