You Only Live Twice is the eleventh novel and twelfth book in Ian Fleming's James Bond series. It was first published by Jonathan Cape in the United Kingdom on 26 March 1964 and quickly sold out. It was the last novel Fleming published in his lifetime. He based his book in Japan after a stay in 1959 as part of a trip around the world that he published as Thrilling Cities. He returned to Japan in 1962 and spent twelve days exploring the country and its culture.

You Only Live Twice begins eight months after the murder of Tracy Bond, James Bond's wife, which occurred at the end of the previous novel, On Her Majesty's Secret Service (1963). Bond is drinking, gambling heavily and making mistakes on his assignments when, as a last resort, he is sent to Japan on a semi-diplomatic mission. While there he is challenged by the head of the Japanese Secret Service to kill Dr. Guntram Shatterhand. Bond realises that Shatterhand is Ernst Stavro Blofeld—the man responsible for Tracy's death—and sets out on a revenge mission to kill him and his wife, Irma Bunt. The novel is the concluding chapter of the "Blofeld Trilogy", which had begun in 1961 with Thunderball.

The novel deals with the change in Bond from an emotionally shattered man in mourning, to a man of action bent on revenge, to an amnesiac living as a Japanese fisherman. Through the mouths of his characters, Fleming also examines the decline of post-Second World War British power and influence, particularly in relation to the United States. The book was popular with the public, with pre-orders in the UK totalling 62,000; reviewers were more muted in their reactions, many criticising the extended sections of what they considered a travelogue.

The story was serialised in the Daily Express newspaper—where it was also adapted for comic strip format—and in Playboy magazine. In 1967 it was released as the fifth entry in the Eon Productions James Bond film series, starring Sean Connery as Bond; elements of the story were also used in No Time to Die (2021), the twenty-fifth film in the Eon Productions series. The novel has also been adapted as a radio play and broadcast on the BBC.

Plot After the wedding-day murder of his wife, Tracy, the Secret Service agent James Bond goes into a decline, drinking and gambling heavily, making mistakes and turning up late for work. His superior in the Secret Service, M, had been planning to dismiss Bond, but decides to give him a last-chance opportunity to redeem himself by assigning him to the diplomatic branch of the organisation. Bond is subsequently re-numbered 7777 and handed an "impossible" mission: persuading the head of Japan's secret intelligence service, Tiger Tanaka, to share a decoding machine codenamed Magic 44 and so allow Britain to obtain information from encrypted radio transmissions made by the Soviet Union. In exchange, the Secret Service will allow the Japanese access to one of their own information sources.

Bond is introduced to Tanaka—and to the Japanese lifestyle—by an Australian intelligence officer, Dikko Henderson. When Bond raises the purpose of his mission with Tanaka, it transpires that the Japanese have already penetrated the British information source and Bond has nothing left to bargain with. Instead, Tanaka asks Bond to kill Dr. Guntram Shatterhand, who operates a politically embarrassing "Garden of Death" in a rebuilt ancient castle on the island of Kyushu; people visit the grounds, replete with poisonous plants, to kill themselves. After examining photos of Shatterhand and his wife, Bond realises that the couple are actually Tracy's murderers, Ernst Stavro Blofeld and Irma Bunt. Bond gladly takes the mission, keeping his knowledge of Blofeld's identity a secret so that he can exact revenge for his wife's death. Made up and trained by Tanaka, and aided by the former Japanese film star Kissy Suzuki, Bond attempts to live and act as a mute Japanese coal miner in order to penetrate Shatterhand's castle. Tanaka gives Bond the cover name "Taro Todoroki" for the mission.

After infiltrating the Garden of Death and the castle where Blofeld spends his time dressed in the costume of a samurai warrior, Bond is captured and identified as a British secret agent. After nearly being executed, Bond exacts revenge on Blofeld in a duel, the former with a wooden staff and the latter armed with a sword. Bond eventually kills Blofeld by strangling him in a fit of violent rage; he then destroys the castle by using the castle's volcanic geyser. Upon escaping, he suffers a head injury, leaving him an amnesiac living as a Japanese fisherman with Kissy. Meanwhile, the rest of the world believes him dead, and his obituary appears in the newspapers.

While Bond's health improves, Kissy conceals his true identity to keep him forever to herself. Kissy eventually sleeps with Bond and becomes pregnant, and hopes that Bond will propose marriage after she finds the right time to tell him about her pregnancy. Bond reads scraps of newspaper and fixates on a reference to Vladivostok, making him wonder if the far-off city is the key to his missing memory; he tells Kissy he must travel to Russia to find out.

Background and writing history By January 1963 Ian Fleming had published ten books of the Bond series in ten years: nine novels and a collection of short stories. An eleventh book, On Her Majesty's Secret Service, was being edited and prepared for production; it was released on 1 April 1963. Fleming travelled to his Goldeneye estate in Jamaica in January 1963 to write You Only Live Twice, which he did over two months. He followed his usual practice, which he later outlined in Books and Bookmen magazine: "I write for about three hours in the morning ... and I do another hour's work between six and seven in the evening. I never correct anything and I never go back to see what I have written ... By following my formula, you write 2,000 words a day." Towards the end of February 1963 he wrote to his friend and copy editor William Plomer: "I have completed Opus XII save for 2 or 3 pages and am amazed that the miracle should have managed to repeat itself—the 65,000 odd words that is, and pretty odd some of them are!" When he had nearly completed writing You Only Live Twice, Fleming wrote to his friend Richard Hughes, the Far Eastern correspondent of The Sunday Times:

I'm grinding away at Bond's latest but the going gets harder and harder and duller and duller and I don't really know what I'm going to do with him. He's become a personal—if not a public—nuisance. Anyway he's had a good run, which is more than most of us can say. Everything seems too much trouble.

The original manuscript was 170 pages and, of all Fleming's works, it was the one that had least revisions prior to publication. After returning to England, Fleming revised the manuscript while staying in Kent. This included contacting the company secretary of The Times to ask permission to use their masthead above Bond's fictional obituary; the matter was complicated by the presence of the royal arms.

You Only Live Twice is the last book completed by Fleming before his death and the last that was published in his lifetime; he died five months after the UK release of the novel. The story is the third part of what is known as the "Blofeld trilogy", coming after Thunderball, where SPECTRE is introduced, and On Her Majesty's Secret Service, which ends with Blofeld involved in the murder of Bond's wife. Fleming's biographer Matthew Parker considers the novel's mood to be dark and claustrophobic. This reflected Fleming's increasing melancholia, partly as a result of the recent news that he had, at most, five years to live, following his heart attack in April 1961.

Although Fleming did not date the events within his novels, John Griswold and Henry Chancellor—both of whom wrote books for Ian Fleming Publications—have identified timelines based on episodes and situations within the novel series as a whole. Chancellor put the events of You Only Live Twice between 1962 and 1963; Griswold is more precise and considers the story to have taken place between April 1962 and April 1963. The story was written after the film version of Dr. No was released in 1962, and Bond's personality had developed from that in the earlier novels, influenced by the screen persona. Fleming added the elements of humour in Sean Connery's filmic depiction of Bond to You Only Live Twice, giving Bond a more relaxed manner.

Fleming based his novel in Japan after a three-day visit in 1959, as part of a trip around world cities for The Sunday Times. He later wrote his travel book Thrilling Cities (1963) based on the result. He was enthralled by the country, which led to its use as the location for the novel. He revisited Japan in 1962, spending twelve days there. As with his first trip, he was accompanied on his trip around the country by two journalists: Hughes and Torao "Tiger" Saito.

Development Inspirations The novel contains a fictional obituary of Bond, supposedly published in The Times, which provided the first details from Fleming of Bond's early life. Many of the traits were Fleming's own. This included Bond's expulsion from Eton College, which was akin to Fleming's withdrawal from the college by his mother, according to the journalist Ben Macintyre. As with a number of the previous Bond stories, You Only Live Twice used names of individuals and places that were from Fleming's past. Bond's mother, Monique Delacroix, was named after two women in Fleming's life: Monique Panchaud de Bottens, a Swiss girl from Vich in the canton of Vaud, to whom Fleming was engaged in the early 1930s, with Delacroix taken from Fleming's own mother, whose maiden name was Ste Croix Rose.

Fleming named Bond's aunt "Charmian Bond": Charmian was the forename of Fleming's cousin who married his brother Richard. Charmian's sister was called "Pet", which, when combined with a play on words from Monique Panchaud de Bottens, gives Pett Bottom, where Charmian lives. Pett Bottom is also the name of a real place which amused Fleming when he stopped for lunch after a round of golf at Royal St George's Golf Club, Sandwich. In the summer of 1963, shortly after completing the book, Fleming went to Montreux to visit the writer Georges Simenon; he tried to see Monique to reveal her part in his new book, but she refused to meet him.

Blofeld's name comes from Tom Blofeld, a Norfolk farmer and a fellow member of Fleming's gentlemen's club Boodle's, who was a contemporary of Fleming's at Eton. For Blofeld's pseudonym in the novel, Dr. Guntram Shatterhand, Fleming uses the name of an old café he had seen in Hamburg in 1959, "Old Shatterhand". The café was named after a fictional character from a series of Western stories by the German writer Karl May. In his first draft, Fleming named the character Julius Shatterhand, but subsequently crossed it out in favour of Guntram. The characterisation of him dressed as a samurai was taken from the sketch Fleming had come up with thirty-five years earlier for a character called Graf Schlick.

Much of the background material for the novel—particularly the description of the country and Japanese culture—Fleming obtained during his two visits to Japan. So much of the book is taken up with the description that the literary analyst LeRoy L. Panek considers the work to be a "semi-exotic travelogue". Fleming's two companions on his trip, Richard Hughes and Tiger Saito, became Dikko Henderson and Tiger Tanaka in the book. Fleming described Saito as "a chunky, reserved man with considerable stores of quiet humour and intelligence, and with a subdued but rather tense personality. He looked like a fighter—one of those war-lords of the Japanese films". When planning the 1959 trip, Fleming told Hughes: