Vitamin D deficiency is a serious health problem that is associated with many health consequences. The study aimed to assess the knowledge, attitudes, and practices of medical students at Qassim University, Saudi Arabia, regarding vitamin D deficiency. An observational cross-sectional study was conducted among students of Unaizah Colleges of Pharmacy (UCP) and Medicine (UCM) at Qassim University, Saudi Arabia, over a period of 3 months. A well-structured self-administered questionnaire was used for the data collection. Statistical analysis was applied by using SPSS version 22. A 0/1 scoring process was employed to assess the KAP of the participants. The midpoint is considered the cutoff point. A total of 337 complete responses were received. The majority of participants (62.3%) were female. 291 (86.3%) were considered to have good knowledge, with a mean score of 6.326 out of 9. Moreover, 220 (65.2%) of participants had positive attitudes, with a mean score of 4.077 out of 7. Unfortunately, only 9 (2.6%) participants demonstrated satisfactory practices, with a mean score a 0.911 out of 6. Female participants were significantly better than male participants in terms of knowledge and attitudes, but worse in terms of practices. Sun exposure during safe daytime hours is considered the main cause of vitamin D deficiency. Nearly 60% confirmed that KSA indoor activities and the COVID-19 lockdown might maximise vitamin D deficiency. The study reveals a gap in vitamin D knowledge among participants influenced by gender and study year. It suggests educational initiatives for male students to enhance their knowledge regarding vitamin D, while female students are encouraged to prioritise safe sun exposure, minimising the use of umbrellas and sunscreen. It also highlights the role of educational institutions as reliable sources of information and the influence of the COVID-19 pandemic on participants' attitudes and practices towards vitamin D.