Polymer electrolytes based on agarose dissolved in DMSO solvent complexed with different weight percentages of Mg(NO3)2 ranging from 0 to 35 wt% were prepared using a solution casting method. Electrochemical impedance spectroscopy (EIS) was applied to study the electrical properties of this polymer electrolyte, such as ionic conductivity at room and different temperatures, dielectric and modulus properties. The highest conducting film has been obtained at 1.48 × 10−5 S·cm−1 by doping 30 wt% of Mg(NO3)2 into the polymer matrix at room temperature. This high ionic conductivity value is achieved due to the increase in the amorphous nature of the polymer electrolyte, as proven by X-ray diffractometry (XRD), where broadening of the amorphous peak can be observed. The intermolecular interactions between agarose and Mg(NO3)2 are studied by Fourier transform infrared (FTIR) spectroscopy by observing the presence of –OH, –CH, N–H, CH3, C–O–C, C–OH, C–C and 3,6-anhydrogalactose bridges in the FTIR spectra. The electrochemical properties for the highest conducting agarose–Mg(NO3)2 polymer electrolyte are stable up to 3.57 V, which is determined by using linear sweep voltammetry (LSV) and supported by cyclic voltammetry (CV) that proves the presence of Mg2+ conduction.