PurposeResearchers have widely explored and associated corporate social responsibility with firm success. Measuring the relationship between corporate social responsibility (CSR), service quality, corporate reputation, and brand preference by drawing on the stakeholder theory in healthcare industry and developing countries remains a substantial research gap.Design/methodology/approachBased on quantitative research and convenience sampling, data for the study were collected from 320 patients who have undergone treatments in 5 different private hospitals in Tehran, Iran. We analyzed the data using the Smart PLS 3.0 structural equation modeling technique.FindingsThe survey revealed that service quality and CSR are positively linked with corporate reputation, leading to brand preference in the healthcare sector. In addition, the mediating role of brand reputation in the relationship between corporate social responsibility, service quality and brand preference were confirmed.Research limitations/implicationsThe survey was performed in the context of the healthcare industry; however, additional studies are necessary to extrapolate the results to other fields, such as education and food. This research helps guide policymakers, administrators, healthcare managers, and researchers by highlighting the contribution and role of service quality, corporate social responsibility, and corporate reputation in achieving a hospital’s performance.Originality/valueTo the best of the authors’ knowledge, this study also extends research in the diverse literature by examining the relationship between CSR, service quality, corporate reputation, and brand preference by illustrating the stakeholder theory in the context of the healthcare sector.