A variation in batteries' physical or chemical specifications right from the manufacturing process causes a slight difference in battery capacity in a battery pack. The imperfection resulting from the production causes the imbalance state of charge (SoC) level that will eventually start to become significant over long-term operation and lead to irreversible damage to the whole battery pack earlier than the expected battery life cycle. To solve the cell imbalance issue and maximize the usable battery pack capacity, an active cell self-equalization algorithm based on the estimated SoC with 24 lithium-ion batteries connected in series was developed. A bidirectional flyback converter equalizer circuit topology was implemented, allowing the charge transfer from cell to pack and from pack to cell. The results prove that the algorithm is applicable for real-time equalization on an imbalanced battery pack in energy storage management systems (ESMSs).