A comparative study was conducted to investigate the adsorption properties and energy of the pure and B/N-doped single-walled carbon nanotubes (SWCNTs) for surface adsorbed DNA bases adenine(A), thymine(T), cytosine(C) and guanine(G), and the electronic structure of stable adsorption model by using density functional theory calculations with LDA (PWC) method. It shows that B-doping does not cause SWCNTs’ structural distortion but can affect their electronic structures, and the interaction between carbon nanotubes and DNA bases enhanced with, turning the DNA bases adsorption on the surface of SWCNTs to chemical adsorption. N-doping has no obvious effects on the electronic structure of SWCNTs and the DNA bases, which can just be modified by physical adsorption on N-doped carbon nanotubes surface. The study predicts that the a few-electron elements such as B-doping have more advantages in DNA bases adsorption on the surface of the SWCNTs compared with the multi-electron central elements like N-doping.