The molecular mechanisms leading to the establishment of durable immunological memory are inadequately understood, limiting the development of effective vaccines and durable anti-tumor immune therapies. Using a T cell-conditional knockout mouse model and a viral pathogen, we show that expression of the transcription cofactor OCA-B (Pou2af1/Bob.1/OBF-1) within T cells is necessary for proper CD4+ memory T cell formation. We also show that ectopic OCA-B expression is sufficient to drive T cells towards a memory fate, while having minimal effects on primary antiviral effector response. Bulk and single-cell gene expression profiling comparing cells transduced with OCA-B and empty vector at primary effector response identifies changes in gene expression consistent with later memory formation, including genes increased (Tbx21, Il7r, Gadd45b, Socs2) in specific subpopulations by ectopic OCA-B expression. Short-lived effector T cell compartments are expanded but show increased expression of Gadd45b and Socs2, while clusters of effector cells with memory potential show increased expression of Bcl2, Il7r, Tcf7 and Slamf6. We also describe an OCA-B-mCherry reporter mouse allele that selectively labels B and T lymphocytes, and shows high reporter expression in CD4+ TCM cells. We show that elevated OCA-B expression prospectively identifies cells with increased survival capability and memory recall potential. Cumulatively, the results demonstrate that OCA-B is necessary and sufficient to promote CD4 T cell memory in vivo.