This paper presents a real-time energy management algorithm for hybrid ac/dc microgrids involving sustainable energy and hybrid energy storage.This hybrid storage system consists of super capacitors for ultra fast load matching beside lithium-ion batteries for relatively long term load buffering.The energy management algorithm aims mainly at managing the energy with in the systemsuch that the affect of the pulsed loads on the power system stability is minimized.moreover, an average annual saving of around 7% is achieved by shifting loads to off-peak hours.The expected energy needed during the futurepeak, the time of its occurrence and the current state of charge of both elements of the hybrid storage system are all the examples of the inputs to the Algorithm.