Purpose – This study aims to analyze the role of Islamic religiosity in addressing the quarter-life crisis (QLC), with self-confidence as a mediating variable. Design/methodology/approach – This study uses a cross-sectional quantitative method with a survey approach. The participants were 201 Islamic religious education teachers’ candidate from three private universities in Yogyakarta. Data were collected using three psychological scales: Quarter-Life Crisis, Islamic Religiosity, and Self-Confidence. Data analysis used structural equation modeling with the SmartPLS 3.0 program. Findings – The research findings indicate that Islamic religiosity has a significant negative direct effect on QLC and a significant positive direct effect on self-confidence, while self-confidence has a significant negative direct effect on QLC. Furthermore, Islamic religiosity also has an indirect effect on QLC through the mediation of self-confidence. Research implications/limitations – This study suggests the importance of promoting Islamic religiosity as a protective factor against QLC among Islamic religious education teacher candidates. A very important new finding from the study is that Islamic religiosity will increasingly suppress QLC if mediated by self-confidence, and this has not been explained by other studies. However, this study also has limitations, particularly the sample size and the specific religious context, which may affect the generalizability of the findings. Originality/value – This research provides essential insights into how enhancing Islamic religiosity and self-confidence can serve as effective strategies to prevent the quarter-life crisis among future Islamic education teachers.