The perception of music is a complex interaction between what we hear and our interpretation. This is reflected in beat perception, in which a listener infers a regular pulse from a musical rhythm. Although beat perception is a fundamental human ability, it is still unknown whether attention to the music is necessary to establish the perception of stronger and weaker beats, or meter. In addition, to what extent beat perception is dependent on musical expertise is still a matter of debate. Here, we address these questions by measuring the pupillary response to omissions at different metrical positions in drum rhythms, while participants attended to another task. We found that the omission of the salient first beat elicited a larger pupil dilation than the omission of the less-salient second beat. This result shows that participants not only detected the beat without explicit attention to the music, but also perceived a metrical hierarchy of stronger and weaker beats. This suggests that hierarchical beat perception is an automatic process that requires no or minimal attentional resources. In addition, we found no evidence for the hypothesis that hierarchical beat perception is affected by musical expertise, suggesting that elementary beat perception might be independent from musical expertise. Finally, our results show that pupil dilation reflects surprise without explicit attention, demonstrating that the pupil is an accessible index to signatures of unattentive processing.