• We use DID method to identify the causal effect of trust on pay gap in China. • We find that trust can significantly reduce pay gap. • Our conclusions are more pronounced in non-SOEs, and firms with weaker corporate governance or lower media attention. • We provide evidence that the trust enhances firm productivity by reducing pay gap. Although the pay gap plays an important role in firm performance, little attention is paid on the impact of trust on within-firm pay gap. Using the construction of China's social trust system as a quasi-natural experiment, we examine the causal effect of trust on within-firm pay gap based on the data of China's A-share listed companies from 2010 to 2018. We find that trust can significantly reduce such gap. Our findings are more pronounced in non-state-owned enterprises, firms with weaker corporate governance, and firms with lower media attention. Finally, we provide evidence that trust enhances firm productivity by reducing pay gap. Overall, this study enriches the research on the driving factors of pay gap at the firm level and the consequences of social trust.