Deletion of master regulators of the B cell lineage reprograms B cells into T cells. Here we found that the transcription factor Hoxb5, which is expressed in uncommitted hematopoietic progenitor cells but is not present in cells committed to the B cell or T cell lineage, was able to reprogram pro-pre-B cells into functional early T cell lineage progenitors. This reprogramming started in the bone marrow and was completed in the thymus and gave rise to T lymphocytes with transcriptomes, hierarchical differentiation, tissue distribution and immunological functions that closely resembled those of their natural counterparts. Hoxb5 repressed B cell 'master genes', activated regulators of T cells and regulated crucial chromatin modifiers in pro-pre-B cells and ultimately drove the B cell fate-to-T cell fate conversion. Our results provide a de novo paradigm for the generation of functional T cells through reprogramming in vivo.