To describe the features of hepatitis B virus (HBV) infection in Madagascar, a randomized sero-epidemiological survey was undertaken in the general population ≥ 1 year old of two provinces which represents 45% of the total population. In the 921 sera tested, the prevalence of HBV markers was 20·5% for HBsAg, 38·2% for anti-HBc and 6·9% for HBeAg. HBsAg and anti-HBc prevalence rates were significantly higher in males. A large difference in HBsAg prevalence was observed between urban (5·3%) and rural areas (26·0%). The same contrast in prevalence was noticed for the other HBV markers. In rural areas, HBV infection was more frequently acquired early in infancy, which suggests predominantly perinatal or postnatal transmission. The presence of HBV markers was not significantly associated with a history of blood transfusion, surgery or parenteral injection. High infectivity carriers represented 5·3% and the overall frequency of chronic carriers was 10·4%. These results place Madagascar among areas of high endemicity.