Alternatives to the current lithium-ion-based car batteries are at the forefront of the automotive industry’s research agenda—manufacturers want to build cars with longer battery life, and to do that they’re going to have to find new solutions. One promising battery material is magnesium (Mg)—it is more dense than lithium, it is safer, and the magnesium ion carries a two-electron charge, giving it potential as a more efficient energy source. Magnesium has a high volumetric capacity, which could mean more battery power in a smaller space. However, to bring Mg batteries to the commercial market, researchers must create new electrolytes with improved properties. The x-ray absorption spectroscopy (XAS) facilities at the ALS are vital to understanding the interfaces and active species in Mg batteries.