On Oct. 24 at 6:24 p.m., Magic 96.5 in Birmingham, Alabama, flipped its “St. Nick” switch. The soft-rock radio station began playing all holiday music all the time.

Magic 96.5 (WMJJ-FM) was one of the first stations in 2014 to give listeners exactly what they want at year’s end: more the Madonna than Madonna. In fact, there’s an entire library of songs that are in constant demand now, but people cringe if they hear them months before.

Radio’s wall-to-wall holiday format is a recent development. Of course, stations in the past played some Christmas music on Dec. 24 and 25, but the vast majority of soft-rock stations began switching to all-holiday soundtracks in the 1990s. The first to throw out its regular playlist entirely was 99.9 KEZ (KESZ-FM) in Phoenix, in 1991 or 1992. The variety station saw a substantial jump in its ratings, and the trend eventually caught on nationwide.

Radio programmers, as well as music-streaming services such as Spotify, do a healthy amount of planning, data work and market research to create seasonal soundtracks that people want to hear — but not hear too soon. Streaming services need to keep subscribers happy, and doing so requires sophisticated algorithms to keep Christmas out for 11 months and cranked up for one. For radio, the stakes are even higher. A station that flips its format can see its ratings triple in an especially good December (and gain from the commensurate advertising that comes along with them).

But when is the best time to push the holiday tunes?

Darren Davis, iHeartMedia’s president of networks and a former programmer in several major cities, laid down what’s going through the heads of people behind the playlist at your local radio station.

“Some programmers decide far in advance exactly when they’re going to start,” Davis said. In areas where there’s competition in the Christmas sector — “that holiday battle” among stations, Davis called it — programmers can be ready to flip the format at a moment’s notice in an effort to keep up with or beat the competition. In the past, Davis said he never picked a specific date, but instead was prepared to make the switch by Nov. 1 — just in case.

“That could be a sudden cold snap coming in, and it starts snowing one afternoon. It could be some big thing going on in the world where everybody’s in a bad mood, and they need a little pick-me-up,” he said.

This year’s flips are mostly behind us, so we can see when they happened. At least 184 iHeartMedia stations in the U.S. and Canada are airing holiday music; there was a huge jump right after Thanksgiving.

The demand for holiday music started to pick up even earlier. Glenn McDonald, who’s in charge of developing the genre algorithm at The Echo Nest, a research company owned by Spotify, provided FiveThirtyEight with the combined number of daily plays of two iconic Christmas tunes — “All I Want For Christmas Is You” by Mariah Carey and “White Christmas” by Bing Crosby — to serve as a sort of Spotify Christmas Industrial Average. Looking at the demand for those two songs from Nov. 1 to Dec. 8, we can see a substantial jump in streams Dec. 1.

What else gets played in December? Do you really want to hear what I hear? And as often as I hear it?

To find out, I pulled the most recently played 8,000 songs on 70 iHeartMedia soft rock, variety and oldies stations that had flipped to their holiday format. These are the most-played songs on holiday radio:

If you think the same songs are played over and over and over, you’re right. The top 15 songs compose half of the music played on holiday radio; the top 53 songs make up 90 percent of the spins. And for a holiday ostensibly about a religious figure’s birthday, the most popular songs on the radio are vastly secular.

Terrestrial radio wants to attract a loyal and diverse set of listeners, so that could explain why five of the top 15 songs are generic wintry tunes and three are from iconic 1960s TV specials — think “Rudolph the Red-Nosed Reindeer” — and none is overtly religious. In fact, the first such song on the list, by my estimation, is at No. 23 — “Little Drummer Boy.”

Of course, many of these songs have been recorded by many different artists. Here are the top-played songs by percentage of all Christmas music narrowed down specifically by who covered them:

A whopping 99.8 percent of the plays of “Feliz Navidad” were Jose Feliciano’s recording, and our list is dominated by the same sort of field-clearing renditions that render subsequent covers undesirable. This is an effect iHeartMedia’s Davis has observed — people desire some new versions to keep a mix lively, he said, but listeners overall crave the version they grew up with. Christmas is a fundamentally nostalgic holiday.

The work to pick the songs can begin as early as July. Similar to the process by which it maintains its classic rock mix, iHeartMedia conducts market research to figure out a December cocktail. It needs to decide which new holiday albums — those can be recorded as late as June — will perform well. The cocktail doesn’t change much year to year, but programmers’ goal is to have no guesswork and no surprises to deal with by November. “We’re going into the Christmas season with advance notice of what people are excited to hear,” Davis said.

Also in summer, advertisers are already thinking ahead because the holiday format dominates the medium at year’s end. It’s not uncommon, Davis said, for soft rock, variety and oldies stations to start the new year in a better ratings position than they held in October; rock and sports stations may see ratings drop as people hop over to the holiday format. If the format wasn’t such a ratings slayer, everybody wouldn’t be doing it. It’s a tinsel-coated juggernaut.

For streaming services, there’s an entirely different suite of nuts to crack.

Spotify’s challenge isn’t to figure out what holiday music listeners want to hear in December — subscribers decide that on their own. Instead, it’s to identify tunes people don’t want to hear the other 11 months of the year. If you’re listening to David Bowie in July, for instance, Spotify wants to make sure his “Little Drummer Boy” duet with Bing Crosby doesn’t queue. Elvis fans may love the King, but they usually don’t care about “Blue Christmas” in April.

Any half-decent band will cut a quick holiday track every now and again. It was McDonald’s job to develop an algorithm to find that song and make sure nobody hears it on Spotify radio for most of the year.

“We actually have a fairly intricate mechanism to try to identify Christmas music,” McDonald said. First, he builds a list of obvious holiday songs. He then identifies the albums those songs appear on. Then his algorithm looks at all the other songs on those albums to see how often they appear elsewhere, and will try to decide if they’re Christmas songs by iterating the process to figure out which songs only appear on other Christmas albums. The process isn’t infallible, but after enough repetitions, McDonald said, “we have a pretty good idea of a fairly complete universe of Christmas songs.”

Another idiosyncrasy of holiday music occurs around Thanksgiving. The Echo Nest built algorithms to find new artists who are bubbling up through the streaming service. (For instance, its “discovery” feature identified the surge in popularity of New Zealand artist Lorde right before she swept the States.) The discovery algorithm searches for situations when the popularity of a song rises substantially faster than the popularity of the song’s artist. This becomes a problem in November, because Spotify starts seeing “Home for the Holidays” crooner Perry Como — who has been dead for 13 years — suddenly start behaving like an indie band out of Portland, Oregon, that’s about to make it big. As a result, Spotify has had to factor in data from external references to determine metrics for artist familiarity in order to make sure up-and-coming music charts don’t look like your grandfather’s record collection.

“Anything that you do that just looks at songs without remembering to look at the artist-level metrics can be pretty easily fooled by this hot new artist named ‘Bing,’” McDonald said.

What’s coming down the chimney on the streaming front this month? There’s a somewhat different mix of holiday songs than what’s on the radio — it’s a lot more contemporary. Here are the top 10 on Spotify as of Dec. 9:

[spotify id=”spotify:user:fivethirtyeightonrotation:playlist:0W2zZIXCld9tMHmbpyzQfY” width=”300″ height=”380″ /]

In the end, no one — aside from our nation’s major retailers, television networks and moms — is forcing anyone to listen to holiday music. But the main reason for the tunes’ ubiquity is that people want to hear them. Folks who are already tired of the stuff can take heart from the fact that there are people working hard to make sure you don’t hear another joyful note after New Year’s Day.

That is, until next December. Or if you’re in Birmingham, October.

CORRECTION (Dec. 12, 10:30 a.m.): A previous version of this article incorrectly referred to iHeartMedia by its previous name, Clear Channel.