We have studied the electronic characteristics of chemically modified single-walled carbon nanotubes by oxygen doping using first-principles density-functional calculations. The oxygen doping, a controlled [2 + 1] cycloaddition scheme, is shown to modify the π-conjugation and impact on the near-infrared band gaps. The implications of tailoring the electronic structure of oxygen doped carbon nanomaterials for future device applications are discussed.