The genetic variability of hepatitis B virus (HBV) represents a challenge for the sensitivity of immunologic and molecular based assays. Based on sequence divergences in the entire genome of >8 %, HBV genomes have been classified into ten genotypes designated as A to J. The aim of this study was to determine HBV genotypes and subtype in samples of HBV infected patients in Bangladesh. The sera samples were collected from chronically infected HBV patients. At first the DNA positive HBV samples were screened by EIA in our laboratory and the 1063 bp region of surface gene was amplified, sequenced and genotyped by sequence analysis. The same sequences were also used for subtypes and mutational analyses. After that, genotyping was also carried out by nested PCR using genotype specific primers in the same region of HBV surface gene. A total of 39 samples were sequencing to find out the genotypes and subtypes. It was found that the prevalent genotype was genotype C (subgenotype C1) which accounted for 48.7 %. The other genotypes found were genotype A (23.1 %) and genotype D (28.2 %). Predominant subtypes in Bangladesh were adr (41 %) followed by subtype adw2 (28.2 %), ayw3 (25.6 %), and others. Additionally, genotyping was also done by nested PCR using type-specific primers. In this method, out of 17 samples 6 were found to be genotype C, followed by genotype D (4 of 17) and genotype A (3 of 17). In PCR-based genotyping system we also observed the mix genotypes; 3 samples contained both genotype A and D, and 2 samples contained both C and D. The genetic diversity of HBV and distribution of its genotypes and subtypes amongst Bangladeshi population were done in this study, which will help us to provide information regarding circulating genotypes in this region and also help physicians to prescribe proper antiviral/interferon therapy.Electronic supplementary materialThe online version of this article (doi:10.1186/s40064-016-1840-2) contains supplementary material, which is available to authorized users.