As a part of industrial or commercial discharge, the influx of nanoplastics (NPs) to the wastewater treatment plants is inevitable. Consequently, it has become a must to understand the effects of these NPs on different unit processes. This study aimed to investigate the impact of three different concentrations of polystyrene nanoplastics (PsNPs) on the fermentation of primary sludge (PrS), implemented in batch anaerobic bioreactors, at pH 5 and 10, considering the pH-dependent nature of the fermentation process. The results showed that PsNPs stimulated hydrogen gas production at a lower dose (50 μg/L), while a significant gas suppression was denoted at higher concentrations (150 μg/L, 250 μg/L). In both acidic and alkaline conditions, propionic and acetic acid predominated, respectively, followed by n-butyric acid. Under both acidic and alkaline conditions, exposure to PsNPs boosted the propagation of various antibiotic resistance genes (ARGs), including tetracycline, macrolide, β-lactam and sulfonamide resistance genes, and integrons. Notably, under alkaline condition, the abundance of sul2 gene in the 250 μg PsNPs/L batch exhibited a 2.4-fold decrease compared to the control batch. The response of the microbial community to PsNPs exposure exhibited variations at different pH values. Bacteroidetes prevailed at both pH conditions, with their relative abundance increasing after PsNPs exposure, indicating a positive impact of PsNPs on PrS solubilization. Adverse impacts, however, were detected in Firmicutes, Chloroflexi and Actinobacteria. The observed variations in the survival rates of various microbes stipulate that they do not have the same tolerance levels under different pH conditions.