Decoding the neural representations of pain is essential to obtaining an objective assessment as well as an understanding of its underlying mechanisms. The complexities involved in the subjective experience of pain make it difficult to obtain a quantitative assessment from the induced spatiotemporal patterns of brain activity of high dimensionality. Most previous studies have investigated the perception of pain by analyzing the amplitude or spatial patterns in the response of the brain to external stimulation. This study investigated the decoding of endogenous pain perceptions according to resting-state magnetoencephalographic (MEG) recordings. In our experiments, we applied a beamforming method to calculate the brain activity for every brain region and examined temporal and spectral features of brain activity for predicting the intensity of perceived pain in patients with primary dysmenorrhea undergoing menstrual pain. Our results show that the asymmetric index of sample entropy in the precuneus and the sample entropy in the left posterior cingulate gyrus were the most informative characteristics associated with the perception of menstrual pain. The correlation coefficient (ρ=0.64, p<0.001) between the predicted and self-reported pain scores demonstrated the high prediction accuracy. In addition to the estimated brain activity, we were able to predict accurate pain scores directly from MEG channel signals (ρ=0.65, p<0.001). These findings suggest the possibility of using the proposed model based on resting-state MEG to predict the perceived intensity of endogenous pain.