This research aims to study the ethics of pesantren (Islamic boarding schools) from the perspectives of two prominent figures, Al-Ghazali and Immanuel Kant, by examining their approaches to morality and character building of students. By using descriptive qualitative research methods and literature study, this research analyzes the ethical concepts of both figures and their implications for educational practices in pesantren. Al-Ghazali emphasizes the importance of noble character rooted in spiritual dimensions and self-control, while Immanuel Kant offers the concept of categorical imperative which focuses on universal moral duty and rationality. This study finds that integrating Al-Ghazali's spiritual approach with Immanuel Kant's rationality can provide a strong foundation for the character formation of students that not only focuses on religious values but also on universal moral responsibilities. The results of this paper are expected to have a positive impact both theoretically and practically for the development of pesantren curriculum, particularly in efforts to produce a generation of students with high morality, critical thinking skills, and the ability to face global challenges while adhering to pesantren's ethical values.