The standard electrode potential of Mg2+ | Mg can be measured with respect to the standard hydrogen electrode, represented by
Pt(s), H2(g) (1 atm) | H+(aq)(1 M).
A cell, consisting of Mg | MgSO4 (aq 1 M) as the anode and the standard hydrogen electrode as the cathode, is set up.

Then, the emf of the cell is measured and this measured emf is the standard electrode potential of the magnesium electrode.
Eø = EøR - EøL
Here,EøR for the standard hydrogen electrode is zero.
∴ Eø = 0 - EøL
= - EøL