Ionic liquids (ILs) are widely used “green solvent” as they have a low vapor pressure and can replace volatile solvents in industry. However, ILs are difficult to biodegrade and are potentially harmful to the environment. This study, herein, investigated the toxicity of three imidazole ILs ([C8MIM]Cl, [C8MIM]Br, and [C8DMIM]Br) towards soil microorganisms. The results showed that the ILs inhibited the growth of soil culturable microorganisms (fungi, bacteria, and actinomycetes) and affected the activity of soil enzyme. In addition, microbial community species and abundance in soil were altered, with significant differences between the control and experimental groups. Alpha diversity analysis showed that the community abundance tended to increase and then decrease with increasing ILs concentrations. The decrease in species abundance implied that the soil microbial system was less resilient to disturbance. Finally, functional prediction analysis revealed that ILs mainly affected the carbohydrate metabolism and amino acid metabolic processes of the microorganisms. ILs with single methyl substituent had a more pronounced effect than those with double methyl substituents. This study contributes to a better understanding of the environmental safety and ecological risks of ILs.