Heparanase (HPSE), an endoglycosidase that cleaves heparan sulfate, regulates a variety of biological processes that promote tumor progression. In this study, we analyzed the correlation between HPSE expression and prognosis in cancer patients, using multiple databases (Oncomine, TIMER, PrognoScan, GEPIA, Kaplan–Meier plotter, miner v4.1, DAVID). HPSE expression was significantly increased in bladder, breast, lung, and stomach cancer compared to matched normal tissues. The increased HPSE expression correlated with poor prognosis and increased immune infiltration levels of B cells, CD8+ and CD4+ T cells, macrophages, neutrophils and dendritic cells in bladder and breast cancer. In breast cancer, the high HPSE expression was associated with basal-like subtypes, younger age (0-40), advanced Scarff-Bloom-Richardson grade, Nottingham Prognostic Index and p53 mutation status. In addition, using a mouse model of breast cancer, our data showed that HPSE upregulated IL-10 expression and promoted macrophage M2 polarization and T cell exhaustion. Together, our data provide a novel immunological perspective on the mechanisms underlying breast cancer progression, and indicate that HPSE may serve as a biomarker for immune infiltration and prognosis in breast cancer.