Salinity is a critical environmental factor in marine ecosystems and has complex and wide-ranging biological effects. However, the effects of changing salinity on diversity and ecological functions of high nucleic acid (HNA) and low nucleic acid (LNA) bacteria are not well understood. In this study, we used 16S rRNA sequencing and metagenomic sequencing analysis to reveal the response of HNA and LNA bacterial communities and their ecological functions to salinity, which was decreased from 26 ‰ to 16 ‰. The results showed that salinity changes had significant effects on the community composition of HNA and LNA bacteria. Among LNA bacteria, 14 classes showed a significant correlation between relative abundance and salinity. Salinity changes can lead to the transfer of some bacteria from HNA bacteria to LNA bacteria. In the network topology relationship, the complexity of the network between HNA and LNA bacterial communities gradually decreased with decreased salinity. The abundance of some carbon and nitrogen cycling genes in HNA and LNA bacteria varied with salinity. Overall, this study demonstrates the effects of salinity on diversity and ecological functions and suggests the importance of salinity in regulating HNA and LNA bacterial communities and functions.