As the expanding obese population grows older, their successful immunologic aging will be critical to enhancing the health span. Obesity increases risk of infections and cancer, suggesting adverse effects on immune surveillance. Here, we report that obesity compromises the mechanisms regulating T-cell generation by inducing premature thymic involution. Diet-induced obesity reduced thymocyte counts and significantly increased apoptosis of developing T-cell populations. Obesity accelerated the age-related reduction of T-cell receptor (TCR) excision circle bearing peripheral lymphocytes, an index of recently generated T cells from thymus. Consistent with reduced thymopoiesis, dietary obesity led to reduction in peripheral naive T cells with increased frequency of effector-memory cells. Defects in thymopoiesis in obese mice were related with decrease in the lymphoid-primed multipotent progenitor (Lin-Sca1+Kit+ Flt3+) as well as common lymphoid progenitor (Lin-Sca1+CD117(lo)CD127+) pools. The TCR spectratyping analysis showed that obesity compromised V-beta TCR repertoire diversity. Furthermore, the obesity induced by melanocortin 4 receptor deficiency also constricted the T-cell repertoire diversity, recapitulating the thymic defects observed with diet-induced obesity. In middle-aged humans, progressive adiposity with or without type 2 diabetes also compromised thymic output. Collectively, these findings establish that obesity constricts T-cell diversity by accelerating age-related thymic involution.