There is little molecular data from Anaplasma marginale and Anaplasma centrale isolates from cattle in Uganda. Between November 2013 and January 2014, blood was collected from 240 cattle in 20 randomly-selected herds in two districts of the Karamoja Region in north-eastern Uganda. A duplex quantitative real-time polymerase chain reaction (qPCR) assay was used to detect and determine the prevalence of A. marginale (targeting the msp1β gene) and A. centrale (targeting the groEL gene). The qPCR assay revealed that most cattle (82.9%; 95% confidence interval [CI] 78.2–87.7%) were positive for A. marginale DNA, while fewer cattle (12.1%; 95% CI 7.9–16.2%) were positive for A. centrale DNA. A mixed effects logistic regression model showed that the age of cattle was significantly associated with A. centrale infection, while the prevalence of A. marginale varied significantly according to locality. The near full-length 16S ribosomal RNA (16S rRNA) gene and the heat shock protein gene, groEL, for both Anaplasma species were amplified from a selection of samples. The amplicons were cloned and the resulting recombinants sequenced. We found three novel A. marginale 16S rRNA variants, seven A. marginale groEL gene sequence variants and two A. centrale groEL gene sequence variants. Phylogenetic trees were inferred from sequence alignments of the 16S rRNA gene and GroEL amino acid sequences determined here and published sequences using maximum likelihood, Bayesian inference and parsimony methods Phylogenetic analyses classified the 16S rRNA gene and GroEL amino acid sequences into one clade for A. marginale and a separate clade for A. centrale. This study reveals a high prevalence and sequence variability of A. marginale and A. centrale, and is the first report on the phylogenetic characterisation of A. marginale and A. centrale from cattle in Uganda using molecular markers. Sequence variation can be attributed to mobile pastoralism, communal grazing and grazing with wildlife. These data support future epidemiological investigations for bovine anaplasmosis in Uganda.