The invention, belonging to the field of dispatching and management of a distribution network, provides a method and system for switching a microgrid between an island mode and a grid connected mode. When an external electric network has a fault, distributed power in a microgrid system is cut off, a grid connected contact breaker of the microgrid system and the external electric network is opened, a voltage and a frequency of the microgrid system are regenerated by a main power switching control mode in the microgrid system, and the microgrid system works independently; and when the external electric network returns to normal, if the electric network side voltage of the grid connected contact breaker is monitored to be normal and is lasted for a certain time, operations of a fan, a photovoltaic power generation system and an energy storage system of a storage battery are stopped, the grid connected contact breaker of the microgrid system is closed, a load is powered with the external electric network, the devices such as the fan and the like are reconnected to the grid for operation, so that a stable operation of the microgrid system in a transient state process of switching between the island mode and the grid connected mode is satisfied, the transient time is shortened, and the requirements of the microgrid system in safety, reliability and quick response are satisfied. The method and system have the characteristics of quickness, stability and reliability.