The increasing number of diversified small-scale farms (DSSF) that raise outdoor-based livestock in the USA reflects growing consumer demand for sustainably produced food. Diversified farms are small scale and raise a combination of multiple livestock species and numerous produce varieties. This 2015–2016 cross-sectional study aimed to describe the unique characteristics of DSSF in California, estimate the prevalence of Shiga toxin-producing Escherichia coli (STEC) in livestock and evaluate the association between risk factors and the presence of STEC in livestock, using generalised linear mixed models. STEC prevalence was 13.62% (76/558). Significant variables in the mixed-effect logistic regression model included daily maximum temperature (OR 0.95; CI95% 0.91–0.98), livestock sample source (cattle (OR 4.61; CI95% 1.64–12.96) and sheep (OR 5.29; CI95% 1.80–15.51)), multiple species sharing the same barn (OR 6.23; CI95% 1.84–21.15) and livestock having contact with wild areas (OR 3.63; CI95% 1.37–9.62). Identification of STEC serogroups of public health concern (e.g. O157:H7, O26, O103) in this study indicated the need for mitigation strategies to ensure food safety by evaluating risk factors and management practices that contribute to the spread and prevalence of foodborne pathogens in a pre-harvest environment on DSSF.