Understanding interactions at the interfaces of carbon with ionic liquids (ILs) is crucially beneficial for the diagnostics and performance improvement of electrochemical devices containing carbon as active materials or conductive additives in electrodes and ILs as solvents or additives in electrolytes. The interfacial interactions of three typical imidazolium-based ILs, 1-alkyl-3methylimidazolium bis(trifluoromethanesulfonyl)imide (AMImTFSI) ILs having ethyl (C 2), butyl (C 4) and octyl (C 8) chains in their cations, with highly oriented pyrolytic graphite (HOPG) were studied in-situ by electrochemical scanning tunneling microscopy (EC-STM). The etching of HOPG surface and the exfoliation of graphite/graphene flakes as well as cation intercalation were observed at the HOPG/C 2 MImTFSI interface. The etching also takes place in C 4 MImTFSI at-1.5 V vs Pt but only at step edges with a much slower rate, whereas C 8 MIm + cations adsorbs strongly on the HOPG surface under similar conditions with no observable etching or intercalation. The EC-STM observations can be explained by the increase in van der Waals interaction between the cations and the graphite surface with increasing length of alkyl chains.