A cross-sectional study was carried out on 200 randomly selected farms in each of the Iringa and Tanga regions of Tanzania to estimate the prevalence and risk factors for subclinical mastitis in dairy cows kept by smallholders. Subclinical mastitis was assessed using the California mastitis test (cmt), and by the bacteriological culture of 1500 milk samples collected from 434 clinically normal cows. The percentages of the cows (and quarters) with subclinical mastitis were 75·9 per cent (46·2 per cent) when assessed by the cmt and 43·8 per cent (24·3 per cent) when assessed by culture. Factors significantly associated with an increased risk of a cmt-positive quarter were Boran breed (odds radio [or]=3·51), a brought-in cow (rather than homebred) (or=2·39), peak milk yield, and age. The stripping method of hand milking was associated with a significantly lower prevalence of cmt-positive quarters (or=0·51). The cmt-positive cows were more likely to be culture positive (or=4·51), as were brought-in (or=2·10) and older cows.