The TiO2 and ZnO nanoparticles are the most promising next-generation photodynamic therapy (PDT) photosensitizers. This paper reports a one-to-one comparison of TiO2 and ZnO nanoparticles as photosensitizers in photodynamic therapy of cancer. After incubating SMMC-7721 hepatocarcinoma cells with TiO2 and ZnO nanoparticles, we irradiated the cells with ultraviolet (UV) light and formation of intracellular reactive oxygen species (ROS) was monitored using the dichloro-dihydro-fluorescein diacetate (DCFH-DA) method. The cytotoxicities of ZnO and TiO2 nanoparticles as photosensitizers in cancer PDT were evaluated using a 3-(4,5-dimethylthiazol-2-yl)-2,5-diphenyltetrazolium bromide (MTT) assay. Furthermore, the mRNA and protein expression levels of apoptosis-related gene, including Bax, Bcl-2, and Caspase 3 were examined using RT-PCR and Western blot to elucidate the possible molecular mechanisms involved. Our results demonstrated that both TiO2 and ZnO nanoparticles could generate ROS within the tumor cells after irradiation, which in turn could attack the cancer cells. The caspase-dependent apoptosis was thus induced, resulting in anticancer activity. When the therapeutic effects were compared, no differences between the TiO2 and ZnO nanoparticles were observed for PDT. Either TiO2 or ZnO nanoparticles can therefore be used in the near future as alternative photosensitizers in targeted tumor PDT when light is directly focused on the lesion.