Juvenile delinquency is not a new phenomenon; in fact, it tends to increase and is a concern. On the other hand, Islamic boarding schools are considered capable of being an important instrument that can be used as a tool to solve adolescent problems, which in this context is minimizing and anticipating juvenile delinquency. This paper presents a framework for analyzing the formation of legal culture in Islamic boarding schools, drawing on the theory of Maqasid Shari'ah. The results of this paper are that the formation of legal culture in Islamic boarding schools is achieved by consistently strengthening the power of conscience, coupled with faith, to lead to good things, so that education is not only the transfer of knowledge but also forms people with high awareness, by improving the aspect of discipline. Furthermore, from the perspective of the theory of maqasid al-shari'ah', legal culture in Islamic boarding schools can be understood, one of which is the relationship between kiai and santri from the perspective of hifz al-din, which has a significant contribution to legal culture in Indonesia. This is because kiai, as educators and role models, help instill deep religious values in students. In addition, Kiai, as educators and role models, help instill deep religious values in students.