Structural and optical properties of graphene with a vacancy and B, N, O and F doped graphene have been investigated computationally using density functional theory (DFT). We find that B is a p-type while N, O and F doped graphene layers, as well as graphene with a vacancy are n-type semiconductors. Optical properties for both cases of in plane (E ⊥ c) and out of plane (E || c) polarization of light are investigated. It is observed that with the increase in the number of electrons entering the supercell, the amount of absorption of the system decreases and the absorption peaks are transferred to higher energies (blue shift).