Gamma rays from neutron capture in natural magnesium and in enriched 25Mg have been studied with Ge(Li) detectors. Altogether 101 γ-rays have been observed. Most of these γ-rays could be fitted into the level schemes of 25Mg, 26Mg and 27Mg. The Q-values for the following reactions have been determined 25Mg(n,γ) 25Mg Q= 7332.8±0.4 keV, 25Mg(n,γ) 26Mg Q= 11096.0±0.5 keV, 26Mg(n,γ) 27Mg Q= 6446.3±0.9 keV, 56Fe(n,γ) 57Fe Q= 7643.9±1.5 keV, 63Cu(n,γ) 64Cu Q= 7916.5±1.5 keV, 207Pb(n,γ) 208Pb Q= 7371.0±2.5 keV, If it is assumed that the capture cross section for natural magnesium amounts to 64±3 mb, the capture cross sections for 24Mg, 25Mg and 26Mg have been determined as 52±13 mb, 182±50 mb and 34±10 mb, respectively.