To achieve higher engineering efficiency in solar cells, group-DT compound semiconductors, such as silicon (Si) or germanium (Ge), in the form of thin films containing carbon (C) and/or tin (Sn) atoms, are gaining attention as alternatives to poly-silicon crystals. Atomic configurations of C and Sn atoms near the (001) surface of a Si thin film were analyzed by first-principles calculation based on density functional theory (DFT). The results of the analysis are threefold. First, C and Sn atoms are most stable at the first atomic layer of the Si thin film, and the surface does not affect the stability of C or Sn atoms deeper than the fifth layer. Second, C and Sn atoms deeper than the fifth layer do not affect the stability of newly arrived C and Sn atoms at the surface during film growth. The effects of the (001) surface and interacting C and/or Sn atoms on the thermal-equilibrium concentrations of C and Sn in each layer of the Si thin film were evaluated in consideration of the degeneracy of the atomic configurations. Third, in the case of mono-doping, formation energy of C (Sn) at the (001) surface increases with increasing concentration of surface C (Sn). In the case of co-doping at C/Sn concentration ratio of 1:1, the formation energies of C and Sn decrease with increasing surface concentrations of C and Sn. It is concluded from these results that co-doping enhances the incorporation of C and Sn atoms in the Si thin film.