The track is the final song on side two (disc one on CD) of the band's 1968 double album, The Beatles (also known as "White Album") and was the last song recorded for the album. It was also released as the "B side" of the Beatles single "Ob-La-Di, Ob-La-Da" in 1976.

He told me he wanted to write a song about his mother. He said, "Donovan, you're the king of children's songs. Can you help me? ... I want to write a song about the childhood that I never really had with my mother." He asked me to help him with the images that he could use in lyrics for a song about this subject. So I said, "Well, when you think of the song, where do you imagine yourself?" And John said, "I'm at a beach and I'm holding hands with my mother and we're walking together." And I helped him with a couple of lines, "Seashell eyes / windy smile" — for the Lewis Carroll, Alice in Wonderland feel that John loved so much.[2]

No other Beatle sings or plays on the song. While Paul McCartney made several "solo" recordings attributed to the group, dating back to his famous song "Yesterday", this is the only time that Lennon played and sang unaccompanied on a Beatles track.

"Julia" was written for John's mother, Julia Lennon (1914–1958), who was knocked down and killed by a car driven by a drunk off-duty police officer when John was 17 years old.[3] Julia Lennon had encouraged her son's interest in music and bought him his first guitar. But after she split with John's father, John was taken in by his aunt, Mimi, and Julia started a new family with another man; though she lived just a few miles from John, Julia did not spend much time with him for a number of years.[4] Their relationship began to improve as he neared adolescence, though, and in the words of his half-sister, Julia Baird: "As he grew older, John would stay with us more often. He and Daddy got along well enough, and in the evenings when our daddy, a headwaiter, was at work, John and Mummy would sit together and listen to records. She was an avid Elvis Presley fan, and she and John would jive around the room to 'Heartbreak Hotel' and other early Elvis recordings. John inherited his love of music from her, and she encouraged him to start with piano and banjo, making him play a tune again and again until he got it right."[5]

"I lost her twice," Lennon said. "Once as a five-year-old when I was moved in with my auntie. And once again when she actually physically died."[4]

The song was also written for his future wife Yoko Ono, whose first name, which literally means "child of the sea" in Japanese, is echoed in the lyric "Oceanchild, calls me."[6] Towards the end of his life, he often called Yoko "Mother."[4]

The line "Half of what I say is meaningless, but I say it just to reach you" was a slight alteration from Kahlil Gibran's "Sand and Foam" (1926) in which the original verse reads, "Half of what I say is meaningless, but I say it so that the other half may reach you". Lennon also adapted the lines "When I cannot sing my heart, I can only speak my mind" from Gibran's "When life does not find a singer to sing her heart she produces a philosopher to speak her mind".

The song is in the key of D and begins with a I–vi7–v7–v9–VI7 progression from D chord note A on "Jul..." to Bm7 chord on "...ia" to Am7 chord on "Jul..." to Am9 chord on "...ia" to B7 chord on "ocean child".[7] A feature is that the ninth degree in the minor ninth chord Bm9 (1–♭3–5–♭7–9) is heard in the melody as well as the guitar chord (at 0.20secs on "Julia, Ju-li-a).[8]

"Julia" was originally released as the final song on side two of The Beatles on 22 November 1968.[9] In 1976, it was released as the B-side of the "Ob-La-Di, Ob-La-Da" single.[10] In 1988 "Julia" was one of the nine Beatles songs on the soundtrack album Imagine: John Lennon.