The synthesis and characterization of two magnesium porphyrins [Mg(TDMPP)(H2O)2], 1 and [Mg(TDMPP) (pyz)2], 2 where TDMPP = 5,10,15,20-tetrakis(3,5-dimethoxyphenyl)porphyrin and pyz = pyrazine have been described. The compound 1 in the presence of pyrazine forms hexa-coordinated compound [Mg(TDMPP)(pyz)2], 2. Both compounds were structurally characterized. Theoretical calculations like structure optimization, calculation of energy of molecular orbitals and simulation of electronic spectra were performed. The HOMO-LUMO energy difference in compound 2 (2.53 eV) is slightly lower than in compound 1 (2.56 eV) which supports the redshift of UV-Vis peaks on binding pyrazine to compound 1.