In this work, NiFe2O4/g-C3N4 heterostructure was prepared and used for the photocatalytic decomposition of tetracycline hydrochloride antibiotic and for inactivation of E. coli bacteria. The fabricated NiFe2O4/g-C3N4 composite displayed enhanced ability for photodegradation of organic pollutants and disinfection activities compared to the bare samples, because of the enhancement of visible light absorbance, heterojunction formation and photo-Fenton process. The optimized sample 10%-NiFe2O4/g-C3N4 has photodegraded 94.5% of tetracycline hydrochloride in 80 min. The active species trapping experiments revels that ·O2−, h+ and •OH are key decomposing species participated in the antibiotic degradation. It is hoped that the present study will provide a better understanding to fabricate efficient photocatalysts for the decomposition of organic pollutants and disinfection of bacteria.