"4 in the Morning" was written by Stefani and Kanal, who was also responsible for its production, while Mark "Spike" Stent provided additional production.Described as a 1980s-inspired mid-tempo synthpop ballad, the track's instrumentation includes a "light" keyboard, which "runs tie the song together from intro through break", a guitar, synthetic strings and a slick sheen.