Why Spotify Shuffle isn’t really random

Joe Fedewa / How-To Geek

If you’ve ever used the shuffle button on Spotify, you’ve probably noticed that it often doesn’t feel random at all. Turns out it’s designed that way, and there’s actually a lot that goes into how shuffle works on Spotify.

You are certainly not alone if this is a complaint you have had. The Spotify Support forums and Reddit are littered with people voicing their grievances about the shuffle feature. It clearly doesn’t work the way people expect it to work. Let’s see why that is.

RELATED: Why is it called Spotify?

Random doesn’t feel random

The core of this situation is ours perception of what is random versus how random works in the real world. The common complaint is that Spotify’s shuffle mode doesn’t feel random, but really random isn’t what we actually want.

Turning a quarter is a good example of this. If the coin is tossed 10 times, we expect a relatively even distribution of heads and tails. However, really random might just as well result in 10 straight heads. Every time the coin is flipped, there is a 50/50 chance that it will be heads or tails. That probability does not change depending on the previous coin flip.

Two lines or colors in random order.
Two equally random orders. Spotify

The same goes for songs in a playlist. True randomness can result in the same artist being played a number of times in a row – there is an equal chance for each song to be played every time. Until 2014, the shuffle function worked like this, but people complained that it wasn’t random enough. So Spotify has changed it.

RELATED: How to search for songs in a Spotify playlist

How Spotify Shuffle works

When you press the “Next” button, Spotify will not randomly select the next song at that time. The next song was already fixed the moment you turned on shuffle mode.

The name “shuffle” is actually a very accurate description of how it works. Think of it like shuffling a deck of playing cards. Tapping the shuffle button on a playlist shuffles all the songs into a new order. This happens every time you click the shuffle button.

You can see this if you check the queue. I made a playlist of 10 songs, half of them by the same artist, and shuffled them five times. Spotify generated a new order of songs every time. Even in this small sample size, you can clearly see some of the issues people are complaining about.

Playlists shuffled.

The first two times I shuffled, the same song was at the top of the list – that’s more “random doesn’t feel random.” More importantly, the artist appearing five times in the playlist is never evenly spaced. In fact, two of the shuffles grouped four of the five songs together.

That’s how Spotify shuffle works on a basic level, but again, this isn’t random. Spotify stopped using True Random in 2014. Now there is an algorithm that determines the shuffle.

RELATED: Stream music? You should create your own playlists

Enter the algorithm

Fortunately, a technician at Spotify outlined exactly how the algorithm works on Spotify’s Engineering blog back in 2014. The algorithm has almost certainly been tweaked since then, but it’s surprisingly simple.

First, the algorithm distributes songs by the same artist. However, it deliberately doesn’t always do this perfectly – as seen above – to maintain a sense of randomness. Generally, they appear every 20-30% of the length of the playlist.

Spotify shuffle algorithm.
Every color is an artist. Spotify.

The algorithm also shuffles songs by the same artist. This is to prevent songs from the same albums from playing too close to each other. Artists that appear only once in the playlist have a “random offset” to prevent them from always being at the top of the list.

That is it! The algorithm itself is quite simple. Maintain a feeling randomness is what really complicates things. If shuffle always arranged the performers perfectly equidistant from each other, it would feel like a repeating pattern. Shuffle must strike a balance between true randomness and manufactured randomness.

Random is hard

There are more advanced music shuffling algorithms. The problem is that adding complexity can make algorithms slower. Spotify’s algorithm is simple, but it allows for almost instant shuffle play.

The human brain makes the concept of “random” difficult to implement. The algorithm is more about making the illusion of randomness than true randomness, because that’s what our brains want. The system will never be perfect, but you can always hit the shuffle button one more time.

If you’re still curious about this topic, check out this excellent video from Gabi Belle on YouTube.

Leave a Comment