Mastitis, inflammation of the mammary gland, can be caused by a wide range of organisms, including gram-negative and gram-positive bacteria, mycoplasmas and algae. Many microbial species that are common causes of bovine mastitis, such as Escherichia coli, Klebsiella pneumoniae, Streptococcus agalactiae and Staphylococcus aureus also occur as commensals or pathogens of humans whereas other causative species, such as Streptococcus uberis, Streptococcus dysgalactiae subsp. dysgalactiae or Staphylococcus chromogenes, are almost exclusively found in animals. A wide range of molecular typing methods have been used in the past two decades to investigate the epidemiology of bovine mastitis at the subspecies level. These include comparative typing methods that are based on electrophoretic banding patterns, library typing methods that are based on the sequence of selected genes, virulence gene arrays and whole genome sequencing projects. The strain distribution of mastitis pathogens has been investigated within individual animals and across animals, herds, countries and host species, with consideration of the mammary gland, other animal or human body sites, and environmental sources. Molecular epidemiological studies have contributed considerably to our understanding of sources, transmission routes, and prognosis for many bovine mastitis pathogens and to our understanding of mechanisms of host-adaptation and disease causation. In this review, we summarize knowledge gleaned from two decades of molecular epidemiological studies of mastitis pathogens in dairy cattle and discuss aspects of comparative relevance to human medicine.