The extraction of nucleic acids from microorganisms for subsequent molecular diagnostic applications is still a tedious and time-consuming procedure. We developed a method for the rapid preparation of genomic DNA from bacteria based on hydrophilic ionic liquids (ILs). First, we tested eight ILs in different buffer systems for their inhibitory effects on quantitative PCR. The cell lysis potential of different IL/buffer combinations was assessed by application on Enterococcus faecalis as a model organism for Gram-positive bacteria. The two best ILs, choline hexanoate and 1-ethyl-3-methylimidazolium acetate, were compared with the reference enzymatic method and two commercial DNA extraction kits. All methods were evaluated on four Gram-positive and four Gram-negative bacterial species that are highly relevant for environmental, food, or clinical diagnostics. In comparison to the reference method, extraction yields of the IL-based procedure were within one order of magnitude for most of the strains. The final protocol for DNA extraction using the two ILs is very low-cost, avoids the use of hazardous chemicals and can be performed in five minutes on a simple heating block. This makes the method ideal for high sample throughput and offers the opportunity for DNA extraction from bacteria in resource-limited settings or even in the field.