It doesn’t matter what kind of music with a beat you like — rock, salsa, jazz, R&B, country, K-pop, rap or club music — if you find yourself wanting to get up and dance when you hear a tune with a groove, your brain as well as your body is likely to benefit.

Japanese researchers had 51 people listen to three minutes of a groove rhythm (GR) — music that has a good beat and tends to make people want to move to the music — and three minutes of the sound of a white-noise metronome, to compare participants’ psychological and physiological responses to music and background sounds.

They used a form of brain imaging, functional near-infrared spectroscopy (fNIRS), and a color-word matching task to look at changes in their brains as they listened to the two sounds and to track certain executive functions before and after listening to music.

The next time a tune makes you want to get up and dance, go for it. The music is likely giving your brain a boost, too.

Then they asked participants to describe how the music made them feel. Descriptors included “Having fun,” “Excited, “Bored,” “Wanting to stop listening,” “Feeling clear-headed” and “Feeling discomfort.”

People’s emotional responses to listening to groove rhythm tended to predict changes in executive function based on activity in the dorsolateral prefrontal cortex or l-DLPFC. Those who responded positively to music with a beat showed stimulation in brain areas associated with executive functions such as attention and planning, suggesting that listening and moving to music can benefit aging brains as much as aging bodies.

“The results were surprising,” researcher, Hideki Soya, a member of the Faculty of Health and Sport Sciences at the University of Tsukuba, said. “Groove rhythms elicit groove sensations and positive affective responses.” But he added, “We found that groove rhythm enhanced executive function and activity in the l-DLPFC only in participants who reported that the music elicited a strong groove sensation and the sensation of being clear-headed.”

So if certain songs make you want to get up and dance, go for it, knowing that the good feeling you are getting is giving your brain a boost, too.

The study is published in Scientific Reports.