3D bioprinting enables the fabrication of printable tissues, including those for neural, cartilage, and skin repair. The mechanical properties, especially stiffness, of 3D-bioprinted scaffolds are crucial for modulating cell adhesion, growth, migration, and differentiation. The stiffness of a scaffold can be adjusted post-printing by modifying the hydrogel concentration, crosslinker concentration, light intensity during photocrosslinking, and duration of crosslinking. The optimization of these conditions to produce the desired scaffold stiffness for a particular cell type or application is a time-consuming and rigorous process. This study developed an innovative approach to predict the compression modulus of 3D-printed gelatin methacryloyl (GelMA) scaffolds using the Bayesian optimization (BO) algorithm. Through just 10 iterations (75 experimental data points), the model was able to predict > 13,000 possible compression modulus values in a search space comprising four independent variables (GelMA concentration, crosslinker concentration, ultraviolet light [UV] distance, and UV exposure time). This approach can be utilized in other photocrosslinkable bioinks for 3D printing that have a myriad of pre- or post-printing parameters that can affect scaffold stiffness.