Methylation of the cytosine base at CpG dinucleotides is traditionally considered antagonistic to the DNA-binding activity of the majority of transcription factors (TFs). Recent in vitro studies of TF-DNA interactions have revealed a more complex picture, suggesting a heterogeneous cytosine methylation impact that varies across TFs, with over a third of TFs preferring methylated sequences. Expanding these in vitro observations to in vivo TF binding preferences, however, is challenging, as the effect of methylation of individual CpG sites cannot be easily isolated from the confounding effects of DNA accessibility and regional DNA methylation. As a result, the in vivo methylation preferences of most TFs remain uncharacterized. Here, we introduce Joint Accessibility-Methylation-Sequence (JAMS) models for inferring the effect of CpG methylation on TF binding in vivo. JAMS creates quantitative models that connect the strength of the binding signal observed in ChIP-seq to the DNA accessibility of the binding site, regional methylation level, DNA sequence, and base-resolution cytosine methylation. Furthermore, by jointly modeling both the control and pull-down signal in a ChIP-seq experiment, JAMS isolates the TF-specific effects from background effects, revealing how methylation of specific CpGs within the binding site alters the TF binding affinity in vivo. We show that JAMS can quantitatively model the TF binding strength and learn the accessibility-methylation-sequence determinants of TF binding. JAMS models are reproducible and generalizable across cell lines, and can faithfully recapitulate cell type-specific TF binding. Systematic application of JAMS to 2368 ChIP-seq experiments generated high-confidence models for 260 TFs, revealing that 45% of TFs are inhibited by methylation of their potential binding sites in vivo. In contrast, only 6% prefer to bind to methylated sites, including 11 novel methyl-binding TFs. Comparison of these in vivo models to in vitro data confirmed high precision of the methyl-preferences inferred by JAMS. Finally, among the CpG-binding proteins from the ZF-KRAB family of TFs, we observed a disproportionately high preference for methylated sequences (24%), highlighting the role of CpG methylation in determining the genome-wide binding profiles of the TFs from this family.