BackgroundHepatitis B virus (HBV) is a leading cause of liver cancer and remains a global public health concern. The risk of acquiring HBV is higher in HCWs than in non-HCWs. Medical students are considered a high-risk group because similar to HCWs, they tend to be exposed to body fluids and blood during training in clinical settings. New infections can be effectively prevented and eliminated with an increased coverage of HBV vaccination. The purpose of this study was to evaluate HBV immunization coverage and associated factors among medical students attending universities in Bosaso, Somalia.MethodologyAn institutional-based cross-sectional study was conducted. A stratified sampling method was employed to draw a sample from four universities in Bosaso. From each university, participants were selected using a simple random sampling technique. Self-administered questionnaires were distributed among 247 medical students. The data were analysed with SPSS version 21, and the findings are presented in tables and proportions. The chi-square test was used to measure statistical associations.ResultsAlthough 73.7% of the respondents had an above-average knowledge level of HBV and 95.9% knew that HBV can be prevented by vaccination, only 2.8% were fully immunized, while 5.3% were partially immunized. The students reported six main reasons for not being vaccinated: unavailability of the vaccine (32.8%), high vaccine cost (26.7%), fear of vaccine side effects (12.6%), lack of trust in vaccine quality (8.5%), lack of awareness about where to get vaccinated (5.7%), and lack of time (2.8%). Occupation and the availability of HBV vaccination in the workplace were associated with HBV vaccine uptake (pvalues of 0.005 and 0.047, respectively).ConclusionHBV immunization coverage among medical students was extremely low (2.8%), indicating the urgent need for increased vaccination coverage in this population. This should start with evidence-based advocacy for the development of a clear national HBV elimination policy, followed by implementing effective, large-scale immunization strategies and interventions. Future studies should expand the sample size to include multiple cities for increased representativeness and conduct HBV titre tests among participants.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-023-15992-2.