Adopting the rst-principles calculation method based on density functional theory, we investigate the electronic and optical properties of alkali atoms (Li, Na and K) and oxygen (O) atoms adsorption of doped graphene nanoribbons. We further inspected the differential charge density, energy band structure, partial state density, electron energy loss spectrum, as well as the valence electron state of impurity atoms. The results revealed the signi cant effect of Li, Na and K atoms on the graphene nanoribbons, presenting n-type direct band gap degenerate semiconductors with the band gap values of 0.438eV, 0.529eV and 0.494eV, respectively. An increase in the adsorption of O in turn changed the materials into p-type direct band gap degenerate semiconductors with the band gap values of 0.573eV, 1.011eV and 0.967eV, respectively. Partial charge density demonstrated a charge migration between the atoms, resulting in a certain change in the electronic properties of the materials. Additionally, the hybridization and local effects of the adsorbed atoms and C atoms resulted in the promotion of the electronic properties near the Fermi level to be signi cantly modulated.