First principles calculations were performed to study the electronic structures of Magnesium diboride (MgBz) bulk and nanosheet with different layer and thickness in order to understand the influence of layer number and thickness on electronic and optical properties for this compound, using the Full Potential Linearized Augmented Plane Waves (FP-LAPW) method with the Generalized Gradient Approximation (GGA) implemented in Wien2k code. It is shown that the MgBz is superconductor with Tc=39K, however MgBz sheet become a nonmagnetic semiconductor and good transparent in the visible range,the absorption coefficient decrease and the superconductor properties appears again with increasing number of layers.