The invention discloses a simulator supporting an EEPROM power failure test. The simulator comprises an EEPROM, a simulation chip, a machine tool power supply detection module, and a power supply module; the machine tool power supply detection module can automatically detect a power supply state of a contact type or non-contact type machine tool, and controls the simulation chip to be in a non-reset state, namely, a normal working state, through a reset signal line when the machine tool is powered; the machine tool power supply detection module controls the power supply module to supply power to the EEPROM by a power supply line through a control signal; the machine tool power supply detection module controls the simulation chip to enter the reset state through the reset signal line when the machine tool is not powered, namely, the machine tool loses the power, so as to enable the simulation chip not to work; and the machine tool power supply detection module controls the power supply module to no longer supply the power to the EEPROM by the power supply line through the control signal, namely, the EEPROM loses the power. According to the simulator, the development, debugging and testing of user programs can be facilitated and the code development efficiency is improved.