Echinococcus granulosus is a helminth from the family Taeniidae, which causes cystic echinococcosis (CE) in humans and diverse livestock around the world. The identification of existing genotypes in different regions is a major step towards the prevention and establishment of control programmes for the disease. This study aimed to detect CE genotypes using polymerase chain reaction–restriction fragment length polymorphism (PCR–RFLP) of the internal transcribed spacer-1 (ITS1) gene and sequencing of the cytochrome c oxidase subunit 1 (Cox1) gene in isolates from the central part of Mazandaran province, northern Iran. Forty isolates were collected from sheep, 17 from cattle and 6 from human formalin-fixed paraffin-embedded tissues (FFPE). The ITS1 and Cox1 genes were successfully amplified by PCR in 41 and 42 samples, respectively. PCR-RFLP and sequencing showed that all isolates had the G1–G3 genotypes in this study. Out of 31 isolates subjected to sequencing for the Cox1 gene, 80.7% had the G1 genotype. G2 (16.1%) and G3 (3.2%) genotypes were observed in five sheep and one cattle samples, respectively. Five human isolates were also sequenced for the ITS1 gene, which showed that all samples belonged to the G1 genotype. Ten haplotypes were determined among the isolates by alignment analysis of the Cox1 gene. In summary, this study demonstrated that G1 was the dominant genotype circulating between humans and livestock in the studied region. Furthermore, high genotypic diversity among the CE isolates was observed.