Thymus medulla epithelium establishes immune self-tolerance and comprises diverse cellular subsets. Functionally relevant medullary thymic epithelial cells (mTECs) include a self-antigen-displaying subset that exhibits genome-wide promiscuous gene expression promoted by the nuclear protein Aire and that resembles a mosaic of extrathymic cells including mucosal tuft cells. An additional mTEC subset produces the chemokine CCL21, thereby attracting positively selected thymocytes from the cortex to the medulla. Both self-antigen-displaying and thymocyte-attracting mTEC subsets are essential for self-tolerance. Here, we identify a developmental pathway by which mTECs gain their diversity in functionally distinct subsets. We show that CCL21-expressing mTECs arise early during thymus ontogeny in mice. Fate-mapping analysis reveals that self-antigen-displaying mTECs, including Aire-expressing mTECs and thymic tuft cells, are derived from CCL21-expressing cells. The differentiation capability of CCL21-expressing embryonic mTECs is verified in reaggregate thymus experiments. These results indicate that CCL21-expressing embryonic mTECs carry a developmental potential to give rise to self-antigen-displaying mTECs, revealing that the sequential conversion of thymocyte-attracting subset into self-antigen-displaying subset serves to assemble functional diversity in the thymus medulla epithelium.