Recording for "Beautiful Stranger" took place in February 1999 at the Guerilla Beach Studios in Los Angeles, California, as well as the Enterprise Studio in Burbank, California. Along with writing and producing the song with Madonna, Orbit also played the keyboards and the guitar on the track. Damian LeGassick did the programming and additional keyboard while Emma Fowler played the flute. The engineering team included Pat McCarthy, Mark Endert and Dave Chelsea, with McCarthy also mixing the track. Jeff Gregmay and Wassim Zartek were the assistant recording engineers. According to the sheet music published by Musicnotes.com, "Beautiful Stranger" is set in common time and is composed in a key of F major with a mid dance tempo of 128 beats per minute. The song begins with a basic sequence of E–B–F–A–C before moving to the main chord progression of Csus4–C7.