In this paper , we investigate the electron Landau-level stability and its influence on the electron Fermi energy , E _ { F } ( e ) , in the circumstance of magnetars , which are powered by magnetic field energy . In a magnetar , the Landau levels of degenerate and relativistic electrons are strongly quantized . A new quantity g _ { n } , the electron Landau-level stability coefficient is introduced . According to the requirement that g _ { n } decreases with increasing the magnetic field intensity B , the magnetic-field index \beta in the expression of E _ { F } ( e ) must be positive . By introducing the Dirac - \delta function , we deduce a general formulae for the Fermi energy of degenerate and relativistic electrons , and obtain a particular solution to E _ { F } ( e ) in a superhigh magnetic field ( SMF ) . This solution has a low magnetic-field index of \beta = 1 / 6 , compared with the previous one , and works when \rho \geq 10 ^ { 7 } Â g cm ^ { -3 } and B _ { cr } \ll B \leq 10 ^ { 17 } Â Gauss . By modifying the phase space of relativistic electrons , a SMF can enhance the electron number density n _ { e } , and decrease the maximum of electron Landau level number , which results in a redistribution of electrons . According to Pauli exclusion principle , the degenerate electrons will fill quantum states from the lowest Landau level to the highest Landau level . As B increases , more and more electrons will occupy higher Landau levels , though g _ { n } decreases with the Landau level number n . The enhanced n _ { e } in a SMF means an increase in the electron Fermi energy and an increase in the electron degeneracy pressure . The results are expected to facilitate the study of the weak-interaction processes inside neutron stars and the magnetic-thermal evolution mechanism for megnetars .