Recently, in response to unstable global environmental factors, there has been a widespread shift towards online education. Drawing on Bandura’s social learning theory, this study examines the mediating role of academic self-efficacy in the relationship between students’ learning styles and their perceptions of electronic assessment. The research design utilized in this study involved a cross-sectional survey conducted via a web-based questionnaire administered to 342 undergraduate students enrolled in online courses at a private university in Jeddah, Saudi Arabia. The instruments employed included the student perceptions of electronic assessment scale, the academic self-efficacy scale and the student learning style scale, which assessed students’ perceptions of e-assessment, their confidence in learning and completing e-assessment tasks, and their preferred learning styles, respectively. The findings revealed that students held neutral perceptions of electronic assessment and exhibited a moderate level of academic self-efficacy. The contributory learning style emerged as the most favored, while the avoidant style was the least preferred. Importantly, the results demonstrated statistically significant direct and indirect effects of learning styles on students’ perceptions of electronic assessment, mediated by academic self-efficacy. This study has theoretical and practical implications, provides recommendations and highlights opportunities for future research in the field of online learning and electronic assessment.