Lithium-based batteries have had a profound impact on modern society through their extensive use in portable electronic devices, electric vehicles, and energy storage systems. However, battery safety issues such as thermal runaway, fire, and explosion hinder their practical application, especially for using metal anode. These problems are closely related to the high flammability of conventional electrolytes and have prompted the study of flame-retardant and nonflammable electrolytes. Here, we review the recent research on nonflammable electrolytes used in lithium-based batteries, including phosphates, fluorides, fluorinated phosphazenes, ionic liquids, deep eutectic solvents, aqueous electrolytes, and solid-state electrolytes. Their flame-retardant mechanisms and efficiency are discussed, as well as their influence on cell electrochemical performance. We conclude with a summary of future prospects for the design of nonflammable electrolytes and the construction of safer lithium-based batteries.