"For Once in My Life" was written by Ron Miller and Orlando Murden for Motown's Stein & Van Stock publishing company in 1965. Originally a slow ballad, it was first recorded by Connie Haines at Motown in July 1965, but that version stayed unreleased until the 2015 compilation Motown Unreleased 1965. The first release was Jean DuShon's 1966 single on Chess's Cadet label, produced by Esmond Edwards; Berry Gordy reportedly asked Chess not to promote it because Miller had co-written it. Early ballad versions came from Barbara McNair, Nancy Wilson, the Four Tops, the Temptations, Tony Bennett and Frank Sinatra, whose version appeared on My Way in March 1969.
Stevie Wonder's uptempo version, recorded in summer 1967 at Hitsville USA Studio A and produced by Henry Cosby, was released on Tamla on October 15, 1968. It reached No. 2 on the Billboard Hot 100, No. 1 on Cash Box and No. 3 in the UK, where it was certified Platinum. Bassists single out James Jamerson's improvised bass line. Bennett and Wonder later recorded a ballad duet for Duets: An American Classic (2006), which won a Grammy for Best Pop Collaboration with Vocals. The song closes Shrek Forever After.