Trimethylsilylation of cellulose in different 1,3-dialkylimidazolium ionic liquids (IL) with hexamethyldisilazane (HMDS) as a silylating agent was investigated. Trimethylsilyl (TMSi) cellulose with a degree of substitution (DS) greater than 1 is insoluble in the IL. The maximum DS obtained depends on the nature of the anion. Carboxylate and diethylphosphate counterions gave better results than chloride or thiocyanate, which corresponds to the solubility of HMDS in the IL. Controlled silylation with stoichiometric amounts of HMDS was feasible in imidazolium carboxylates and diethylphosphate. Analysis of the substitution pattern of the silyl groups in the anhydroglucose unit (AGU) by methylation analysis gave a more homogeneous distribution under (initially) homogeneous conditions (fewer unsubstituted AGUs, fewer trisubstituted AGUs) compared to TMSi cellulose obtained in liquid ammonia.