For the first time nanoparticles of CdP2 and CdP4 semiconductors were prepared and studied. The nanoparticles were prepared by incorporation into zeolite Na-X matrix. Absorption and photoluminescence (PL) spectra of CdP2 and CdP4 nanoparticles were measured at the temperature of 77 K. Two bands were observed in both the absorption and PL spectra of CdP2 nanoparticles demonstrating the blue shift from the line of free exciton in bulk crystal. Single band was observed in both the absorption and PL spectra of CdP4 nanoparticles demonstrating the blue shift from the spectra of bulk crystal. We attribute the bands to some stable nanoparticles of CdP2 and CdP4 with size less than the size of zeolite Na-X supercage. We observed Stokes shift of the PL bands with respect to the absorption bands for both CdP2 and CdP4 nanoparticles.