productivity 8 min read

Best Music for Coding: What Developers Actually Listen To

coding programming developer music lo-fi focus instrumental

Best Music for Coding: What Developers Actually Listen To

The science behind why 96% of software engineers code with music — and which genres actually help you write better code.

Nearly every developer has an opinion about what to listen to while coding. Some swear by lo-fi beats. Others need death metal. A brave few insist on absolute silence. But what does the research actually say about how music affects programming performance?

The answer is more nuanced than “music helps” or “music hurts.” It depends on what kind of music you’re listening to, what kind of coding you’re doing, and even how familiar you are with the tracks playing in your headphones.

Developers overwhelmingly choose music over silence

Surveys paint a clear picture: coding culture and music are deeply intertwined. A Qualtrics survey of 400 software engineers found that 96% listen to music at least some of the time while coding, with only 6% preferring total silence. A separate Liquid Web survey of 1,000 coders confirmed the pattern — 61% listen specifically to help focus, 60% use music to get “into the zone,” and more than a third always have something playing.

The genre preferences are all over the map. The Qualtrics data showed pop leading at 28%, followed by electronic (12%) and classical (11%). The Liquid Web survey told a different story: rock topped the list at 42%, with rap/hip-hop and pop tied at 37%. The diversity of preferences hints at something important — what genre you choose may matter less than other factors.

Age plays a role too. Engineers under 35 are significantly more likely to always listen while coding (71%) compared to those over 35 (47%). And 80% of developers use headphones, making music a personal workspace tool rather than a shared environment.

The lyrics question is settled: skip them

If there’s one finding the research agrees on, it’s this: lyrics interfere with coding.

A 2023 study published in the Journal of Cognition tested 113–123 college students across verbal memory, visual memory, and reading comprehension tasks. Music with lyrics consistently impaired performance across all three measures. Instrumental lo-fi hip-hop, by contrast, produced no significant harm — though it didn’t improve performance either. The best scores came in silence.

The mechanism is straightforward. Programming relies heavily on the brain’s language-processing centers — you’re reading syntax, writing logic, parsing error messages. Lyrics compete for those same neural resources. Researchers call this “interference-by-process,” and it means that even music you love will hurt your coding if someone’s singing over it.

The study’s conclusion was direct: “Performance was generally best under silence, intermediate in the instrumental condition, and worse in the lyrical condition.”

Why familiar music beats new discoveries

That playlist you’ve heard a thousand times? It might be your best coding companion.

A 2025 study in Brain Sciences tested 96 young adults and found that familiar music produced faster cognitive processing and lower mind-wandering compared to unfamiliar tracks. Earlier research by Feng and Bieldman showed similar results — listeners hearing familiar classical music demonstrated faster response times and better attention spans.

The explanation is elegant: when your brain already knows what’s coming next in a song, it spends less energy processing the music. Predictability reduces cognitive load. That’s why your tenth listen to the same lo-fi playlist feels like it fades into the background, while a brand new album keeps pulling your attention away from the terminal.

The tempo sweet spot for deep work

Not all beats per minute are created equal. Research by Dr. Emma Gray at the British CBT and Counseling Service, conducted in collaboration with Spotify, found that music in the 50–80 BPM range can nudge the brain into an “alpha state” — the brainwave pattern associated with relaxed alertness. This range closely mirrors the average resting heart rate of about 60 BPM, and it overlaps almost perfectly with lo-fi hip-hop’s typical tempo of 60–90 BPM.

Higher tempos aren’t necessarily bad, but they serve different purposes. Moderate BPM (80–100) works for routine tasks like refactoring or writing boilerplate. Faster tempos above 110 BPM can reduce mind-wandering during time-pressure work, but they also increase arousal in ways that may hurt complex problem-solving.

For deep focus work — the kind where you’re architecting a system or debugging something gnarly — slower, steadier tempos give your brain the most room to operate.

Flow state: music as the on-ramp

Mihaly Csikszentmihalyi’s research on flow — that state of effortless concentration where hours feel like minutes — helps explain why music works for so many developers. During flow, the prefrontal cortex partially deactivates (a phenomenon called “transient hypofrontality”), and the brain floods with norepinephrine, dopamine, and endorphins.

Music doesn’t create flow directly, but it modulates arousal to help you reach it. If you’re understimulated and struggling to engage with boring code, the right music raises your energy. If you’re overstimulated and anxious about a deadline, calming music brings you down to the optimal zone. It’s less about the music itself and more about music as a tuning mechanism for your mental state.

This is also why there’s no single “best” genre for coding. The right music depends on where your arousal level is relative to where it needs to be for the task at hand.

The open office made headphones essential

There’s a practical dimension that research often overlooks: most developers don’t work in quiet environments. Open-plan offices are the norm, and a 2022 study in Frontiers in Built Environment confirmed what every developer in an open office already knows — background speech significantly impairs cognitive performance. The Gensler Global Workplace Survey reported that 70% of employees are regularly disturbed by conversations and ambient noise.

Music through headphones serves a dual purpose: it masks disruptive speech while providing a consistent auditory environment. A controlled study by Jahncke et al. found that nature sounds were particularly effective at attenuating the cognitive damage from background speech. And a 2024 study on active noise-canceling headphones found that ANC alone improved subjective experience but not actual cognitive performance — you need to pair noise cancellation with some kind of masking audio for the best results.

In other words, headphones plus music isn’t just a preference. In a noisy office, it’s a cognitive defense strategy.

Why lo-fi hip-hop became the developer’s default

Lo-fi hip-hop’s dominance in coding culture isn’t accidental. Its characteristics are almost engineered for focus work: no lyrics (avoiding language interference), steady tempo in the 60–90 BPM range (promoting alpha states), looped and repetitive patterns (predictable enough to ignore), and ambient textures like vinyl crackle that act as gentle noise buffers.

A 2022 analysis in Organised Sound (Cambridge University Press) described the genre’s production as deliberately constructed — tracks that “begin clean and ‘hi-fi’, then made lo-fi” through intentional degradation. The imperfections aren’t bugs; they’re features that make the sound feel organic and undemanding.

The cultural adoption has been staggering. The Lofi Girl YouTube channel now has over 14 million subscribers, with thousands tuning into the 24-hour livestream at any given moment. A 2024 study in the Journal of Adolescence tested lo-fi’s effects directly: after exposure, participants showed significant reductions in state anxiety, describing the music as “an antidote to anxiety” that “disrupts intrusive thoughts.”

Video game composer Josie Brechner offered a useful frame: “Game music has a lot of repetition, along with variation on musical themes, to keep the player engaged but still focused… and that translates well to doing other work that requires focus and concentration.”

The foundational research: Teresa Lesiuk’s workplace studies

The most cited research on music and programming comes from Teresa Lesiuk at the University of Miami. Her 2005 study in Psychology of Music followed 56 software developers in real Canadian workplaces over five weeks — not a lab setting, but actual offices with actual deadlines.

Her findings were nuanced. Quality of work and positive mood were lowest when music was removed. Time-on-task was longest without music, suggesting developers worked less efficiently in silence. But the benefit wasn’t cognitive enhancement in the traditional sense — it was mood modulation. Developers using music reported better perception during design work through “positive mood change.”

An earlier Lesiuk study with 72 programming students reinforced the pattern: participants who listened to music both before and during programming scored highest, with significantly decreased anxiety. The takeaway isn’t that music makes you smarter. It’s that music makes you feel better, and feeling better makes you code better.

Practical recommendations based on the evidence

For complex problem-solving and architecture work: Choose familiar instrumental music at 60–70 BPM. Lo-fi hip-hop, ambient electronic, or Baroque classical all fit the profile. Keep volume low — you want the music to disappear into the background.

For routine coding, refactoring, and boilerplate: You have more flexibility here. Moderate tempo instrumental music works, and even upbeat tracks are fine for mechanical tasks. Still avoid lyrics if you’re reading or writing any code.

For debugging and code review: Consider silence or very soft ambient sound. These tasks require close reading and pattern recognition, which are most vulnerable to auditory interference.

For noisy environments: Pair noise-canceling headphones with nature sounds or lo-fi beats. The combination of active cancellation and masking audio outperforms either strategy alone.

For getting started when motivation is low: Use higher-energy music to raise arousal, then transition to calmer tracks once you’re engaged. Music is most valuable as an on-ramp to focus, not necessarily as a sustained focus tool.

For everyone: Build playlists of at least 90 minutes to avoid the distraction of frequent song changes. Favor familiar music over new discoveries during deep work. And if silence genuinely works for you, don’t let coding culture convince you otherwise — the research says silence is still the safest default for complex cognitive tasks.


The best coding music is whatever helps you reach and maintain your optimal focus state — and the research suggests that for most developers, that means familiar instrumental tracks at a moderate tempo, played through good headphones. Everything else is personal preference, and that’s perfectly fine.