Hamlisch was born in New York City to Viennese Jewish parents, Lilly Schachter and Max Hamlisch. His father was an accordionist and bandleader. Hamlisch was a child prodigy and by age five he began mimicking music he heard on the radio on the piano. His first job was as a rehearsal pianist for Funny Girl with Barbra Streisand. Shortly after that he was hired by producer Sam Spiegel to play piano at Spiegel's parties. This connection led to his first film score, The Swimmer.
Later he wrote music for several Woody Allen early films, such as Take the Money and Run.Among his best known work during the 1970s were adaptations of Scott Joplin's ragtime music for the motion picture The Sting, including its theme song, 'The Entertainer'. He had great success with The Way We Were in 1974, winning two of his three 1974 Academy Awards. He also won four Grammy Awards in 1974, two for ' The Way We Were .' He co-wrote 'Nobody Does It Better' for the 1977 James Bond film The Spy Who Loved Me with his then-girlfriend Carole Bayer Sager. (John Barry was unable to work in the United Kingdom due to tax reasons.) He also wrote the orchestral/disco score for the film, which was re-recorded for the album. The song went on to be nominated for an Oscar in 1977.
His latest work is The Informant!, a film by Steven Soderbergh starring Matt Damon.