Activated T cells secrete interferon-γ, which triggers intracellular tryptophan shortage by upregulating the indoleamine 2,3-dioxygenase 1 (IDO1) enzyme1-4. Here we show that despite tryptophan depletion, in-frame protein synthesis continues across tryptophan codons. We identified tryptophan-to-phenylalanine codon reassignment (W>F) as the major event facilitating this process, and pinpointed tryptophanyl-tRNA synthetase (WARS1) as its source. We call these W>F peptides 'substitutants' to distinguish them from genetically encoded mutants. Using large-scale proteomics analyses, we demonstrate W>F substitutants to be highly abundant in multiple cancer types. W>F substitutants were enriched in tumours relative to matching adjacent normal tissues, and were associated with increased IDO1 expression, oncogenic signalling and the tumour-immune microenvironment. Functionally, W>F substitutants can impair protein activity, but also expand the landscape of antigens presented at the cell surface to activate T cell responses. Thus, substitutants are generated by an alternative decoding mechanism with potential effects on gene function and tumour immunoreactivity.