A photocurable silk fibroin hydrogel is prepared, for the first time, using natural silk protein fibroin and biophotosensitizer riboflavin. Riboflavin is excited by ultraviolet light to generate a triplet state which is transferred to produce active oxygen radicals with singlet oxygen as the main component. Active oxygen radicals can induce chemical cross-linking of amino-, phenol- and other groups in the silk fibroin macromolecules to form a photocurable hydrogel. The different biophysical characterizations of the gelation of this modified fibroin protein solution were studied by using Fourier transform infrared spectroscopy, X-ray diffraction, scanning electron microscopy, microplate reader and texture analyzer. The aggregate structures, surface morphologies, mechanical properties, light transmission and degradation properties of the gel were studied. The investigations showed that the silk fibroin/riboflavin hydrogels predominantly have random coils or alpha helix structures. These gels show resilience up to 90% after 80% compression and a light transmission of up to 97%. The cell culture experiment exhibits that the hydrogel has a satisfactory cytocompatibility.