Heparanase (HPSE) is considered to play an important role in the occurrence, development and carcinogenesis of ulcerative colitis (UC). There are no reports about the detection of HPSE mRNA in feces to predict UC activity and cancerization risk. To explore the feasibility and effectiveness of fecal epithelial HPSE mRNA in monitoring patients' UC activity and predicting cancer risk. The clinical part of the study enrolled 20 patients with UC and 20 controls. Meanwhile, a UC-induced carcinogenesis mouse model was established using a combination treatment of dimethylhydrazine and dextran sulfate sodium. Tissue expression of HPSE protein was detected by immunohistochemistry. RT-qPCR was used to detect the expression of HPSE mRNA in colonic mucosa and feces. In the human study, the relative expressions of HPSE mRNA in colonic mucosa and feces were positively correlated with the Mayo score (P < 0.05), and with a significant correlation between feces and colonic mucosa (P < 0.05). In the mouse model, the relative expressions of HPSE mRNA in colonic mucosa and feces in the ulcerative colitis-associated colorectal cancer group was significantly higher than that of the UC group and the normal control group (P < 0.05), and with a significant correlation between feces and colonic mucosa (P < 0.05). The relative level of HPSE mRNA was positively correlated with UC activity and cancerization. The relative level of HPSE mRNA in feces was correlated with that in colonic mucosa. The detection of HPSE mRNA in feces can be used as a new marker for disease monitoring and cancer risk prediction of UC.