Trimethoprim sulfamethoxazole (cotrimoxazole, CTX) is used frequently as part of standard medical care for people living with HIV/AIDS in Africa. The mechanisms of resistance to sulfonamides and trimethoprim in commensal streptococci from Uganda were determined and compared to S. pneumoniae. Commensal streptococci showing high-level resistance to cotrimoxazole were cultured and analysed for species identity and polymorphisms in the genes coding for dihydropteroate synthase (DHPS) and dihydrofolate reductase (DHFR). Seven isolates of S. pneumoniae from blood and cerebrospinal fluid (CSF) were similarly examined. There was considerable polymorphism in both DHPS and DHFR. In DHFR, the mutations E20D and I100L were present in all sequenced isolates. Other mutations such as L135F, and different substitutions in D92, were frequent. The most common DHPS variants had 2 serine residues added after amino acid 60, or arginine and proline added after amino acid 59. In addition, 3 new insertions/substitutions were found. There were no obvious differences between the mutation patterns in S. pneumoniae and commensal streptococci, suggesting that the chromosomal mutations have been spread by transformational interchanges of DNA among related organisms.