The process of charging a capacitor is equivalent to that of transferring charge from one plate to the other plate of the capacitor. Some work must be done to charge a capacitor. This work is stored as electrostatic potential energy in the capacitor.
The formula for energy stored in a capacitor is given by
U = Q2/2C or U = CV2/2 or U = QV/2
Where
Energy stored per unit volume of a capacitor is known as electrostatic energy density.
The formula for the energy density of a capacitor is given by
Energy density, Ud = ϵ0E2 / 2
Its SI unit is Joule per cubic meter (J m-3).