Currently, biopolymer electrolytes are attracting a great deal of interest as substitute for synthetic polymer electrolytes in electrochemical devices, as they are carbon neutral, sustainable, reduce dependency on non-renewable fossil fuels and easily biodegradable. Some of the biopolymers under research are chitosan, pectin, agar–agar, cellulose acetate and carrageenan. The current work deals with the study of ion conducting polymer electrolyte, pectin with magnesium chloride salt for magnesium battery application. Biopolymer electrolytes of different compositions of pectin with different concentrations of magnesium chloride salt are prepared by solution casting technique and subjected to various studies like by X-ray diffraction (XRD), Fourier transform infrared (FTIR), differential scanning calorimetry (DSC), AC impedance spectroscopy and linear sweep voltammetry (LSV). XRD analysis has been used to identify the amorphous/crystalline nature of the sample. The complex formation between the polymer pectin and the magnesium chloride salt has been analyzed by FTIR spectroscopy. DSC analysis is a thermo-analytical technique which is used to observe the glass transition temperature (Tg) of the samples. AC impedance technique has been used to find the ionic conductivities of the sample. The electrochemical stability of the polymer electrolyte has been analyzed by linear sweep voltammetry. Among the prepared polymer electrolytes, 30 M wt% pectin: 70 M wt% MgCl2 offers the highest ionic conductivity of 1.14 × 10−3 S cm−1. The electrochemical stability of the highest conducting sample is 2.05 V. The primary magnesium battery has been constructed using the highest conducting sample, 30 M wt% pectin: 70 M wt% MgCl2, and the battery performance has been studied.