Gastrointestinal (GI) parasites in small ruminants, especially goats and sheep, have caused significant socio-economic and public health challenges worldwide. The aim of the present study was to investigate the diversity and prevalence of GI parasites in goats and sheep in Jiangsu, Shaanxi and Hunan provinces of China, and to assess whether the age of animals, sampling season and feeding mode influence the distribution and infection of GI parasites. A total of 1,081 fecal samples collected from goats (n = 835) and sheep (n = 246) were detected by saturated saline flotation technique and nylon sifter elutriation and sieving method for eggs/oocysts, respectively. Based on the morphological observation of eggs and oocysts, one tapeworm, five nematodes, three trematodes and nineteen coccidia were identified, of which seven helminths belong to zoonotic parasites. The infection rate of parasites was 83.4% (902/1081) in total samples, 91.6% (765/835) in goats, and 55.7% (137/246) in sheep. The infection rate of coccidia was 71.0% (767/1081), and that of helminths was 56.2% (607/1081). The dominant species was E. alijeri (67.3%, 562/835) in goats, E. parva (30.1%, 74/246) in sheep. The highest prevalent helminths were Trichostrongylidae spp. in goats (58.3%, 487/835), and Moniezia spp. in sheep (22.76%, 56/246). Of 902 positive samples, 825 (91.5%, 825/902) contained multiple (2–10) parasites. The feeding mode, sampling season and regions were relevant risk factors which have significant influence on the occurrence of GI parasites in goats and sheep. The risk coefficient of parasite infection in autumn was 2.49 times higher than spring (Odds ratio = 2.49, 95% CI = 1.51–4.09, p < 0.001). Compared to raising on the high beds, the goats and sheep raising on the ground had the higher risk of parasite infection (OR = 3.91, 95% CI = 2.07–7.40, p < 0.001). The risk coefficient of parasite infection in Shaanxi and Hunan was 3.78 and 1.25 times higher than that in Jiangsu (OR = 3.78, 95% CI = 2.01–7.12, p < 0.001; OR = 1.25, 95% CI = 1.21–1.29, p < 0.001). These data are significant for the development of prevention strategies to minimise economic losses from small ruminant production and to reduce the risk of water and food infecting humans as vectors of zoonotic parasitic diseases.