Hydrogels, due to their optical transparency and biocompatibility, have emerged as an excellent alternative to conventional optical materials for biomedical applications. Advances in microfabrication techniques have helped convert conventional hydrogels into optically functional materials such as hydrogel-based diffraction optical elements (hDOEs). However, key challenges related to device customization and ease/speed of fabrication need to be addressed to enable widespread utility and acceptance of hDOEs in the field. Here, we report rapid printing of customized hDOEs on polyethylene glycol diacrylate (PEGDA) hydrogel using digital photopatterning; a novel method that combines simulated computer-generated hologram (SCGH) and projection photolithography. To showcase the versatility of this approach, a range of hDOEs are demonstrated, including 1D/2D diffraction gratings, Dammann grating, Fresnel zone plate (FZP) lens, fork-shaped grating and computer-generated hologram (CGH) of arbitrary pattern. Results demonstrate that printed hDOEs exhibit optical performance that is comparable with devices made with conventional materials. This versatile strategy can be potentially implemented with other photosensitive hydrogels to achieve user-defined hDOEs in a time-efficient and cost-effective fashion.