The electronic structures and optical properties of pure and Sb-doped SnO2 are investigated by first-principles calculations based on the density functional theory. The calculation results show that the Fermi level of SnO2 is located in the band gap, and the maximum of the valence band and minimum of the conduction band are both located at Γ point (the Brillouin zone center), indicating that SnO2 is a direct band gap semiconductor. When one of the 16 Sn atoms in the SnO2 supercell is replaced by one Sb atom, the Fermi level moves into the conduction band and the compound displays metallic characteristics in electronic band structure. For the case of an Sb impurity coexisting with oxygen vacancies, the Fermi level is also located in the conduction band and the density of states near the Fermi level is increased comparing to that without oxygen vacancies. Moreover, some impurity bands depart from the top of the valence band, which narrows the band gap of the compound. With respect to the optical properties, the presence of an Sb impurity in the supercell of SnO2 leads to the occurrence of weak absorptions in the visible region, while the presence of oxygen vacancies reinforces the absorptions.