Purpose Drawing on person–environment fit theory and social cognitive theory, this study aimed to examine how self-efficacy affects nurses’ workplace well-being via person-job fit and the moderating role of digital competence. Methods A two-wave survey was conducted to collect data. Data were collected from six hundred and ninety-five nurses at three Chinese hospitals between May 2022 and September 2022. We employed hierarchical regression analysis and bootstrapping to analyze the data. Results Self-efficacy positively influenced person-job fit (β = .55, p < .001), which positively affected nurses’ workplace well-being (β = .32, p < .001). Person-job fit mediated the effect of self-efficacy on nurses’ workplace well-being. Additionally, digital competence strengthened the positive impact of self-efficacy on person-job fit (β = .12, p < .001). Conclusion Recruiting nurses with both self-efficacy and digital competence benefits hospitals. It is critical for nurses to improve their digital competence for achieving person-job fit and attaining workplace well-being in the post-coronavirus disease 2019 (COVID-19) era.