Coke formation during the methanol-to-olefin (MTO) conversion has been studied at the single-particle level with in situ UV/Vis and confocal fluorescence microscopy. For this purpose, large H-ZSM-5 crystals differing in their Si/Al molar ratio have been investigated. During MTO, performed at 623 and 773 K, three major UV/Vis bands assigned to different carbonaceous deposits and their precursors are observed. The absorption at 420 nm, assigned to methyl-substituted aromatic compounds, initiates the buildup of the optically active coke species. With time-on-stream, these carbonaceous compounds expand in size, resulting in the gradual development of a second absorption band at around 500 nm. An additional broad absorption band in the 600 nm region indicates the enhanced formation of extended carbonaceous compounds that form as the reaction temperature is raised. Overall, the rate of coke formation decreases with decreasing aluminum content. Analysis of the reaction kinetics indicates that an increased Brønsted acid site density facilitates the formation of larger coke species and enhances their formation rate. The use of multiple excitation wavelengths in confocal fluorescence microscopy enables the localization of coke compounds with different molecular dimensions in an individual H-ZSM-5 crystal. It demonstrates that small coke species evenly spread throughout the entire H-ZSM-5 crystal, whereas extended coke deposits primarily form near the crystal edges and surfaces. Polarization-dependent UV/Vis spectroscopy measurements illustrate that extended coke species are predominantly formed in the straight channels of H-ZSM-5. In addition, at higher temperatures, fast deactivation leads to the formation of large aromatic compounds within channel intersections and at the external zeolite surface, where the lack of spatial restrictions allows the formation of graphite-like coke.