5-Methylcytosine (mC) and 5-hydroxymethylcytosine (hmC), the two main epigenetic modifications of mammalian DNA, exist in symmetric and asymmetric combinations in the two strands of CpG dyads. However, revealing such combinations in single DNA duplexes is a significant challenge. Here, we evolve methyl-CpG-binding domains (MBDs) derived from MeCP2 by bacterial cell surface display, resulting in the first affinity probes for hmC/mC CpGs. One mutant has low nanomolar affinity for a single hmC/mC CpG, discriminates against all 14 other modified CpG dyads, and rivals the selectivity of wild-type MeCP2. Structural studies indicate that this protein has a conserved scaffold and recognizes hmC and mC with two dedicated sets of residues. The mutant allows us to selectively address and enrich hmC/mC-containing DNA fragments from genomic DNA backgrounds. We anticipate that this novel probe will be a versatile tool to unravel the function of hmC/mC marks in diverse aspects of chromatin biology.