The song is a music hall comedy number and is perhaps the silliest song in the Beatles' catalogue. Lennon came up with the lyrics and title after seeing a phone book. He said:
McCartney once told Beatles recording analyst Mark Lewisohn, "[People] are only just discovering things like 'You Know My Name (Look Up the Number)'—probably my favourite Beatles' track!" He went on to explain:
The song moves through several sections which appear to be stylistic references to some of the Beatles' contemporaries including Mick Jagger of the Rolling Stones, and Trini Lopez. The Trini Lopez or "lounge" section includes a reference to Dennis O'Dell, associate producer on the A Hard Day's Night film,. Partway through the song, Lennon introduces McCartney as lounge singer "Dennis O’Bell," one consonant away from the name of the film producer Lennon had worked with not only on Hard Day's Night but also How I Won the War. The reference prompted numerous telephone calls to O'Dell's home by fans who told him, "We have your name and now we've got your number," as well as personal visits by fans wanting to live with him.
All four Beatles participated in the first three recording sessions on 17 May, 7 and 8 June 1967. Jones' saxophone part was recorded on 8 June.
The song was left unreleased and untouched until 30 April 1969 when Lennon and McCartney laid down all the vocal tracks and added additional sound effects with the help of Mal Evans. George Harrison and Ringo Starr did not participate in this last session. Nick Webb, second engineer on the 30 April session described it this way:
Despite the fun sessions described by McCartney and Webb, the song was not released for another year.
Although eventually released as a Beatles song, "You Know My Name (Look Up the Number)" was nearly released as the A-side of a Plastic Ono Band single. Lennon was determined to have this song and "What's The New Mary Jane" released, and he arranged for Apple to issue both unorthodox songs on a Plastic Ono Band single. On 26 November 1969, 4 months after Jones drowned in his swimming pool, Lennon edited "You Know My Name (Look Up the Number)", reducing the length from 6 minutes 8 seconds to 4:19, a more suitable length for a single. The Plastic Ono Band single was given an Apple catalogue number (Apples 1002) and British release date (5 December 1969).
Apple issued a press release, describing the record as Lennon and Yoko Ono singing and backed by "many of the greatest show business names of today" which the press believed was a thinly disguised reference to the Beatles. The record was canceled before it was issued.
Three months later, the song was released as the B-side to the Beatles' single, "Let It Be." The original Plastic Ono Band single catalogue number is visible, though scratched out, in the runout groove of the original British pressings of the "Let It Be" single.
"What's the New Mary Jane" was not officially issued by the Beatles until the release of Anthology 3 in 1996, although the song did appear on bootleg records.
"You Know My Name (Look Up the Number)" was the last Beatles song from the group's official canon to be included on an album, issued on 12" vinyl for the first time on Rarities (which had been included as a bonus disc in the British and American boxed set, The Beatles Collection in 1978, and released separately as an album in the United Kingdom in 1979). The first stand-alone American album to feature "You Know My Name (Look Up the Number)" was the U.S. Rarities, which was released in 1980.
The first CD version was issued in 1988 on the Past Masters, Volume Two compilation.
"You Know My Name (Look Up the Number)" was available only in mono until 1996, when an extended stereo mix was finally issued on Anthology 2. However, while this mix restores portions of the song, it omits others that were released on the mono single, causing considerable differences between the mono and stereo versions of the track. For example, the ending of the stereo version has the talking portion fade out, whereas the mono version does not.
A stereo version featuring all five sections uncut has never been released and never appeared on bootlegs.
On the U.S. pressings of the original 7" single, the song was erroneously titled "You Know My Name (Look Up My Number)"