Local pH environment has been considered to be a potential biomarker for tumor diagnosis because solid tumors contain highly acidic environments. A pH-sensing nanoprobe based on surface-enhanced Raman scattering (SERS) using nanostars under near-infrared excitation has been developed for potential biomedical applications. To theoretically investigate the effect of protonation state on SERS spectra of p-mercaptobenzoic acid (pMBA), we used the density functional theory (DFT) with the B3LYP functional to calculate Raman vibrational spectra of pMBA-Au/Ag complex in both protonated and deprotonated states. Vibrational spectral bands were assigned with DFT calculation and used to investigate SERS spectral changes observed from experiment when varying pH value between five and nine. The SERS peak position of pMBA at ~1580 cm−1 was identified to be a novel pH-sensing index, which has small but noticeable downshift with pH increase. This phenomenon is confirmed and well-explained with theoretical simulation. The study demonstrates that SERS is a sensitive tool to monitor minor structural changes due to local pH environment, and DFT calculations can be used to investigate Raman spectra changes associated with minor differences in molecular structure. Copyright © 2013 John Wiley & Sons, Ltd.