T cells recognize tumor antigens and initiate an anti-cancer immune response in the very early stages of tumor development, and the antigen specificity of T cells is determined by the T cell receptor (TCR). Therefore, monitoring changes in the TCR repertoire in peripheral blood may offer a strategy to detect various cancers at a relatively early stages. Here, we developed the deep learning framework iCanTCR to identify cancer patients based on the TCR repertoire. The iCanTCR framework uses TCRβ sequences from an individual as an input and outputs the predicted cancer probability. The model was trained on over 2000 publicly available TCR repertoires from eleven types of cancer and healthy controls. Analysis of several additional publicly available datasets validated the ability of iCanTCR to distinguish cancer patients from non-cancer individuals and demonstrated the capability of iCanTCR for the accurate classification of multiple cancers. Importantly, iCanTCR precisely identified individuals with early-stage cancer with an area under the curve (AUC) of 86%. Altogether, this work provides a liquid biopsy approach to capture immune signals from peripheral blood for non-invasive cancer diagnosis.