In this paper bulk magnesium diboride (MgxB2) with x varying from 0.9 to 1.3 was prepared by solid state reaction. The Mg:B mixing ratio for ideal MgB2 is 1:2. The samples were sintered at 800degC for 60 h. Quantitative X-ray diffraction (XRD) analysis was performed to obtain the lattice parameters, the microstrain, and the weight fraction of impurities using the Rietveld refinement method. It has been found that the fraction of pure MgB2 phase increases from x = 0.9 to x = 1.1, and then decreases with further increases in x. Mg1.1B2 exhibits the highest critical current density, Jc, over other samples in both low fields and high fields. A direct correlation between Jc and connectivity indicates that better connectivity, caused by smaller amounts of impurities, results in the best Jc in Mg1.1B2.