This research has been conducted to identify and rank factors affecting customer loyalty in public libraries in Iran. This research is applied in terms of purpose and mixed (qualitative-quantitative) for the data type. In the first step, 45 articles on library customers’ loyalty were selected and analyzed purposefully using the meta-synthesis method. Then, based on the experts’ opinions and the analysis of the research findings, two factors, ten concepts, and 50 codes were identified, and their validity was confirmed using the Kappa-Kaufman test. In the second step, the weight and the ranking of the identified factors were determined by presenting a questionnaire to the experts and using Shannon’s entropy method. The statistical population of the research in the quantitative part consisted of 52 specialists in the field of public libraries, who were selected by the purposeful sampling method. Intra-library factors (human resources, service quality, physical space and environment, complaint handling, technical resources and facilities, electronic access, and communication) and external factors (mental image or impression, perceived usefulness, and satisfaction) were identified as factors affecting the loyalty of public library customers. In addition, the results obtained through Shannon’s entropy show that human resources, with a weight of 0.13, and mental impression, with a weight of 0.11, are ranked first and second. Moreover, perceived usefulness, technical resources and facilities, physical environment, and satisfaction were ranked third to sixth with a slight difference, with an approximate weight of 0.10. Electronic access, with a weight of 0.9, service quality, with a weight of 0.9. Complaint handling, with a weight of 0.7, and communication, with a weight of 0.6, were ranked seventh to tenth, respectively. The cultivation of customer loyalty in public libraries needs to improve the parameters and factors affecting it, and by prioritizing the most influential factors, customer loyalty will be promoted. The main goal of customer loyalty at public libraries can be achieved by recognizing and reinforcing factors that are essential in the enhancement of customer loyalty, such as growing the specialized, technical, and personal skills of the library staff, improving the social image of the library, providing valuable services for customers, presenting diverse and up-to-date information resources for all groups of society, observing standards in the library design and architecture, providing different electronic resources and types of information, having access to authentic scientific databases, and resolving customer complaints.