The magnetic energy stored in a coil formula is E = 1/2 x L x I┬▓. Where I is the current flowing through the wire, L is the solenoid of inductance and E is the magnetic energy.