If you’re reading this article at work, there’s a decent chance you’re wearing headphones.

It has never been easier to tune in to your own customized soundtrack—or more necessary to tune out your open-office coworkers, cubicle mates, and fellow coffee-shop denizens. But not all music is created equal, especially when there’s work to be done. How should you choose the best office soundtrack for a given task? Which songs will help you get energized, focused, or creative—or even just through a very long day?

Let’s start with the basics.

Listening to music affects your brain

Putting on those headphones provides a direct pipeline from iTunes or Spotify into your auditory cortex. As the music plays, many different brain centers can be activated, depending on whether the music is familiar or new, happy or sad, in a major or minor key, or—perhaps most importantly for work purposes—whether it has lyrics or not.

The Year in Cognitive Neuroscience ​

Some tasks are easier with music playing…

Research shows that music goes best with repetitive tasks that require focus but little higher-level cognition. A landmark 1972 study in Applied Ergonomics found that factory workers performed at a higher level when upbeat, happy tunes were played in the background.

…and some are harder

Don’t fool yourself: Listening to music means that you are multitasking. Any cognitive resources that your brain expends—on understanding lyrics, processing emotions that are triggered by a song, or remembering where you were when you first heard it—won’t be available to help you work.

Studies have shown that reading comprehension and memorization both suffer when music is playing, for example. And just try putting numbers into a spreadsheet while listening to this:

Find the right balance

The downside of listening to music at work is that it places demands on your attention. The upside is it can make you feel more energetic and improve your mood. It’s also useful to drown out distracting background noises. The trick is to choose your music carefully, and match your tunes to the task.

For a cognitive boost, pick music that doesn’t have lyrics…

This makes intuitive sense to anyone who has listened to music at work, especially if your task is word-related. Your brain’s language centers can’t help but decipher the words you’re hearing, which makes it much harder to concentrate on, say, composing an email.

If you simply can’t find music without lyrics, you can pick something in a language that you don’t understand—like the invented “hopelandic” language used by the band Sigur Rós:

…and has a steady rhythm and mood

Your brain is a prediction machine, making a endless series of guesses about what’s going to happen next. When it comes to music at work, you don’t want your brain to spend cognitive resources predicting what it’s about to hear.

Listening to constant, relatively unchanging music—songs that don’t have a lot of emotional peaks and valleys, or changes in mood—has been shown to enhance some simple cognitive skills. Other research has shown that “low-information-load” music—simple tunes without a lot of complexity—have the strongest positive effect.

For instance, check out the steady, phased repetitions of “Music for Airports 1/1” by Brian Eno:

Some studies suggest that major-key music (a song that sounds more happy than sad) makes time seem to pass more slowly. Whether that’s a good thing or not depends on how much you have to get done before you go home.

Don’t play music all the time

The widely cited 1972 study found that the benefits of music disappeared when it was constantly played. And sometimes your brain just needs all the cognitive resources it can get. One 1989 paper wryly noted that “complex managerial tasks are probably best performed in silence.”

Music as a pick-me-up

There’s an one category of workplace listening that has a totally different set of rules: the kind of listening you do when you’re tapping into the power of music to trigger an emotional response. Try playing a rock anthem or an action-movie soundtrack to jump-start your mood, or listen to a favorite song as a reward for a job well done. This gives you many of music’s cognitive benefits but without any of its distracting downsides.

Here’s one to play before a big meeting:

Hit shuffle for a dopamine rush

As mentioned above, your brain thrives on predicting the future, so throwing some randomness into the mix can reward you with a surge of the pleasurable neurotransmitter dopamine. To harness this neurological pharmacy, use a streaming music service like Spotify, Pandora, or Rdio to automatically serve up songs you might like.

Some of the best genres to work to

If you’re ready to experiment with what music best suits your work style, here are some suggestions (links to songs via Spotify):

Try the Quartz work playlist

And here is a playlist of songs, again via Spotify, that the Quartz staff picked as some of their favorites to listen to as they work (A version of the playlist in Rdio can be found here):