Signal transducer and activator of transcription 3 (STAT3) is a transcription factor and regulates tumorigenesis. However, the functions of STAT3 in immune and drug response in cancer remain elusive. Hence, we aim to reveal the impact of STAT3 in immune infiltration and drug response comprehensively by bioinformatics analysis. The expression of STAT3 and its relationship with tumor stage were explored by Tumor Immune Estimation Resource (TIMER), Human Protein Altas (HPA), and UALCAN databases. The correlations between STAT3 and immune infiltration, gene markers of immune cells were analyzed by TIMER. Moreover, the association between STAT3 and drug response was evaluated by the Cancer Cell Line Encyclopedia (CCLE) and Cancer Therapeutics Response Portal (CTRP). The results suggested that the mRNA transcriptional level of STAT3 was lower in tumors than normal tissues and mostly unrelated to tumor stage. Besides, the protein expression of STAT3 decreased in colorectal and renal cancer compared with normal tissues. Importantly, STAT3 was correlated with immune infiltration and particularly regulated tumor-associated macrophage (TAM), M2 macrophage, T-helper 1 (Th1), follicular helper T (Treg), and exhausted T-cells. Remarkably, STAT3 was closely correlated with the response to specified inhibitors and natural compounds in cancer. Furthermore, the association between STAT3 and drug response was highly cell line type dependent. Significantly, the study provides thorough insight that STAT3 is associated with immunosuppression, as well as drug response in clinical treatment.