Cairncross was educated at Glasgow University and Trinity College, Cambridge, where he studied modern languages. After graduating, he worked in the Foreign Office. In 1942, he worked on ciphers at Bletchley Park and MI6. During this time, he passed documents through secret channels to the Soviet Union.
Cairncross admitted to spying in 1951 after MI5 found incriminating papers in his possession. He was never prosecuted, however, which later led to charges that the government engaged in a conspiracy to cover up his role. Indeed, the identity of the infamous "fifth man" in the Cambridge Five remained a mystery until 1990, when a KGB defector named Oleg Gordievsky fingered Cairncross.