A series of steroidal[17,16-d]pyrimidines derived from dehydroepiandrosterone were designed and prepared by a convenient heterocyclization reaction. The in vitro anticancer activities for these obtained compounds were evaluated against human cancer cell lines (HepG2, Huh-7, and SGC-7901), which demonstrated that some of these heterocyclic pyrimidine derivatives exhibited significantly good cytotoxic activities against all tested cell lines compared with 5-fluorouracil (5-FU), especially, compound 3b exhibited high potential growth inhibitory activities against all tested cell lines with the IC50 values of 5.41 ± 1.34, 5.65 ± 1.02 and 10.64 ± 1.49 μM, respectively, which might be used as promising lead scaffold for discovery of novel anticancer agents.