T cells have various subtypes and states with different functions. However, a reference list and automated annotation tool for T cell subtypes and states are lacking, which is critical for analyzing and comparing T cells under various conditions. We constructed the largest human T cell reference, containing 1,348,268 T cells from 35 conditions and 16 tissues. We classified T cells into 33 subtypes and further stratified them into 68 categories according to subtype and state. Based on this reference, we developed a tool named STCAT to automatically annotate T cells from scRNA-seq data by hierarchical models and marker correction. The accuracy of STCAT was 28% higher than that of existing tools validated on six independent datasets, including cancer and healthy samples. Using STCAT, we consistently discovered that CD4 Th17 cells were enriched in late-stage lung cancer patients in multiple datasets, whereas MAIT cells were prevalent in milder-stage COVID-19 patients. We also confirmed a decrease in Treg cytotoxicity in post-treatment ovarian cancer. Systematic landscape analyses of CD4 and CD8 T cell references revealed that CD4 Treg cells were enriched in tumor samples and that CD8 naive-related cells were abundant in healthy individuals. Finally, we deposited all the T cell references and annotations into a TCellAtlas (https://guolab.wchscu.cn/TCellAtlas) database, which allows users to browse T cell expression profiles and analyze customized scRNA-seq data by STCAT. In conclusion, comprehensive human T cell subtypes and states reference, automated annotation tool, and database will greatly facilitate research on T cell immunity and tumor immunology.