AimThe aim of this study was to determine the prevalence of hepatitis B and the risk factors in Morocco. Study designA total number of 16,634 individuals were screened for HBsAg using the Murex HBsAg Version 3 assay and were interviewed using a structured standard questionnaire to collect information about risk factor. ResultsTwo hundred seventy-six subjects were positive for HBsAg, the prevalence of HBV infection was 1.66%. Using a structured standard questionnaire we reported that sexual behaviours (43.84%) are among the main risk factors for HBV transmission. ConclusionThis study indicates that the prevalence of HBsAg in Morocco is currently estimated at 1.66% in the active population. The risk factors for HBV infection identified here indicate that prevention is the most cost-effective method for successfully controlling HBV infection, so vaccination remains the best way to control this infection and its related complications.