In this paper, molecular dynamics simulations were performed to study desalination performance of armchair carbon nanotubes (CNTs). The studied systems included the (7, 7) and (8, 8) CNTs embedded in a silicon nitride membrane immersed in an aqueous ionic solution. For desalinating water, an external electrical field was applied to the systems along the axis of nanotubes. The results indicated that the (7, 7) and (8, 8) CNTs were exclusively selective to ions. The (7, 7) CNT selectively separated sodium ions from aqueous solution. In contrast, the (8, 8) CNT selectively separated chlorine ions. CNTs ion selectivity is justified by calculating the potential of mean force for each ion in the related system. Also, the results were confirmed using the following simulated properties: ion current, retention time of ions, transport rate for water molecules, the average density of water inside the CNTs, and the radial distribution functions of ions-water. Based on the findings of this study, the studied systems can be recommended as a model for the desalination of water.