High electricity consumption in Sarawak’s cities is a concern, driven by residential, industrial, and commercial users. Greater demand for electrical energy requires more electrical resources, affecting grid stability. To prevent blackouts and enhance grid resilience, electric vehicles can serve as distributed energy storage in microgrids. The biggest problem facing energy storage is that not all batteries within energy storage are the same. Every battery cell in the battery pack has a different rate of self-discharge, capacity, internal resistance, and aging, even though they have the same chemical and physical characteristics. These variations lead to power imbalances in energy storage. Therefore, to address this issue, a unique voltage equalization method using a modular flyback converter is presented. Its core objective is to correct voltage imbalances among batteries. The proposed method is modelled using MATLAB, and the performance of the system has been evaluated. Furthermore, the developed model is implemented in a microgrid and tested for two different cases (with and without energy storage for electric cars). From the simulation outcomes, it has been verified that the developed cell balancing technique performs well in equalizing the voltage of cells than the conventional methods.