The electromagnetic calorimeter (ECAL) of the AMS-02 experiment is a 3-dimensional sampling calorimeter, made of lead and scintillating fibers. The detector allows for a high granularity, with 18 samplings in the longitudinal direction, and 72 sampling in the lateral direction. The ECAL primary goal is to measure the energy of cosmic rays up to few TeV, however, thanks to the fine grained structure, it can also provide the separation of positrons from protons, in the GeV to TeV region. A direct measurement of high energy photons with accurate energy and direction determination can also be provided.