In these days of wireless headphones, when we carry thousands of songs in our pockets, it feels impossible to exercise without “Eye of the Tiger” playing in the background. But music isn’t just a cure for boredom while you run. Countless studies have shown the right playlist can actually help you push yourself longer and harder.

Music helps you train better

Researchers have been studying the link between music and exercise performance since 1911, when researcher Leonard Ayres discovered that bicyclists pedaled faster while a band was playing compared to when it was quiet. Much of the recent work has been summarized in a review by Costas Karageorghis and David-Lee Priest, published in the International Review of Sport and Exercise Psychology and available in twoparts.

They found that in over 60 studies, music caused participants to push themselves for a longer period of time, report lower levels of exertion, and maintain a better mood overall. The right tunes can even draw you into a "flow state"—a fancy way of saying you're "in the zone"—which reduces the amount of mental energy you need to expend to keep moving.

However, music’s power is more effective during moderate exercise than high-intensity workouts. In those more vigorous cases, when you're already giving the activity everything you've got, researchers found that music didn't increase performance. That said, it can still improve your mood during those tough workouts.

Music can serve our workouts in two primary ways: asynchronously, in which it acts as a background motivator and mood elevator, and synchronously, in which it helps us keep time as we move. We humans have a natural tendency to synchronize our movements with music, so songs with speedier tempos can unconsciously make you run faster to match your stride with the beat. In these situations, music increases performance even more than it does as simple background music.

Of course, this isn't true for every single persone. Some athletes prefer to focus on their pace and performance, and they find music distracting. If that's you, don't fix what isn't broken. But if you already like the idea of listening to music while you run, then you need the right playlist to really pump you up.

Craft the perfect exercise playlist

Loud, fast songs with lots of bass are always good motivators, according to researchers. The higher the tempo, the more likely you are to push yourself—until you reach around 140 beats per minute. At that point, going faster doesn't necessarily increase performance, at least if you're using music as background motivation.

If you're synchronizing your movements with the beat, however, you can try to match the tempo of your music with your desired pace. This chart from run2rhythm gives you some basic BPM values for different mile paces. For example, if you're aiming for an 8 minute mile, you'll want songs with a tempo of around 166 beats per minute. You can also cut the tempo in half and run with two steps per stride.

Once you know your desired BPM range, head to a site like SongBPM and start plugging in your favorite tunes. SongBPM will tell you the tempo of the music, so you can decide whether it belongs in your playlist or not. Stick to songs that have an even tempo that isn't too complex, since they'll be easier to match with your movements.

The ideal song will have more than just the right tempo, though. In a 2009 study, Karageorghis found that music with motivational qualities drove athletes even harder than music without. So choose music with lyrics that pump you up and motivate you to keep going, like Eminem’s ’Till I Collapse (171 BPM) or Krewella’s Killin’ It (160 BPM).

In addition, researchers found that music works much better as a motivator when participants picked their own music, choosing songs that were more personally or culturally relevant. Instead of loading up a random exercise playlist on Spotify, pick songs that fall into genres you like, fit your personal taste in lyrics, or have emotional significance for you.

Grab the right gear

Researchers are quick to acknowledge the dangers of running with headphones, so if you’re going to listen to music, make sure you do it right. Get an unsealed headphone that lets you hear outside noise, so you can remain aware of your surroundings. We recommend the sweatproof Plantronics BackBeat FIT ($105 on Amazon) or Yurbuds Inspire 200 ($25 on Amazon). Apple’s EarPods are cheaper than our other picks, but unfortunately aren’t waterproof—though they’ll do in a pinch. Unsealed headphones may not sound as good as sealed ones, but safety is more important than sound quality.

As you sweat it out, you don’t want that moisture to make your phone slip out of your hand. A cheap exercise armband can protect it from both sweat and gravity. Alternatively, leave your phone at home and run with an old iPod Shuffle—you can find cheap ones on Craigslist. That way you won’t have to worry about damaging a $700 device when you should be focused on pushing yourself to the limit.

Finally, make sure to keep all your devices—music player and headphones—charged. There’s nothing worse than hearing the music die in the middle of a hard workout.