Newcastle disease (ND) and avian influenza (AI) are issues of interest to avian producers in Madagascar. Newcastle disease virus (NDV) is the major constraint for village aviculture, and avian influenza viruses type A (AIAV) are known to circulate in bird flocks. This study aims at classifying smallholder poultry farms, according to the combination of risk factors potentially associated with NDV and AIAV transmission and to assess the level of infection for each farm class. Two study sites, Lake Alaotra and Grand Antananarivo, were chosen with respect to their differences in terms of agro-ecological features and poultry productions. A typology survey involving 526 farms was performed to identify possible risk factors for (i) within-village, and (ii) between-village virus transmission. A cross-sectional serological study was also carried out in 270 farms to assess sero-prevalences of NDV and AIAV for each farm class and the link between them and risk factor patterns. For within-village transmission, four classes of farms were identified in Grand Antananarivo and five in Lake Alaotra. For between-village virus transmission, four classes of farms were identified for each site. In both sites, NDV sero-prevalence was higher than for AIAV. There was no evidence of the presence of H5 or H7 subtypes of AIAV. Sero-prevalences were significantly higher in Lake Alaotra than in Grand Antananarivo for both viruses (OR=2.4, p=0.02 for NDV, and OR=9.6, p<0.0001 for AIAV). For within-village NDV transmission in Grand Antananarivo, backyard chicken farms (OR=3.6, p<0.001), and chicken farms with biosecurity awareness (OR=3.4, p<0.01) had greater odds of having antibodies against NDV than the others. For between-village virus transmission, farms with multiple external contacts, and farms using many small markets had greater odds of having antibodies against NDV than the others (OR=5.4, p<0.01). For AIAV, there were no differences in sero-prevalences among farm classes. In Lake Alaotra, the observed high density of palmipeds and widespread rice paddies were associated with high sero-prevalences for both viruses, and a homogeneous risk of virus transmission between the different farm classes. In Grand Antananarivo, farm visits by collectors or animal health workers, and farm contacts with several markets were identified as potential risk factors for NDV transmission. Further studies are needed to identify the circulating virus genotypes, model their transmission risk, and provide adapted control measures.