BACKGROUND: Compensation plays a critical role in motivating staff and enhancing operational performance and human resource costs in hospitals. This study was aimed at investigating pay levels and the key factors influencing pay satisfaction in secondary and tertiary public hospitals in Guangxi. METHODS: Questionnaires were distributed to 48 hospitals across 14 prefecture-level cities in Guangxi. Information on personal characteristics, salary levels, work situations and perceptions of current salary conditions was provided by 10,343 staff in secondary and tertiary hospitals. Five machine learning models were employed to identify the most significant influencing factors of salary satisfaction in Guangxi public hospitals. RESULTS: Overall, the actual total after-tax income in secondary public hospitals in Guangxi ranged from 66.55-44, while the income of staff in municipal-level tertiary public hospitals ranged from ,001 to ,041.75 per month. Among the five models, the support vector machine (SVM) demonstrated the best performance in analyzing the influencing factors of compensation satisfaction. The most influential factors for total compensation satisfaction included the extent to which compensation reflected labor value, salary increases since 2017 compared to peer hospitals, total after-tax income and the difference in compensation between staff within and outside the establishment of hospitals. Satisfaction with salary growth aligned closely with the factors influencing overall compensation satisfaction. Satisfaction with pay equity was also influenced by the ability of salary gaps between different positions to reflect differential effort. CONCLUSIONS: A relatively low pay level in secondary hospitals in Guangxi was revealed. The factors influencing satisfaction with total pay, pay fairness and pay growth since 2017 varied. SVM outperformed other models in the analysis of the factors influencing pay satisfaction. To enhance pay satisfaction in secondary and tertiary hospitals in Guangxi, it is crucial to establish a salary distribution system aligned with the value of labor across different positions and tailored to the unique characteristics of each hospital.