Fitzgerald began planning his third novel in June 1922, but it was interrupted by production of his play, The Vegetable, in the summer and fall. The play failed miserably, and Fitzgerald worked that winter on magazine stories struggling to pay his debt caused by the production. The stories were, in his words, "all trash and it nearly broke my heart," although included among those stories was "Winter Dreams", which Fitzgerald later described as "a sort of first draft of the Gatsby idea".
After the birth of their child, the Fitzgeralds moved to Great Neck, New York, on Long Island, in October 1922; the town was used as the scene for The Great Gatsby. Fitzgerald's neighbors in Great Neck included such prominent and newly wealthy New Yorkers as writer Ring Lardner, actor Lew Fields, and comedian Ed Wynn. These figures were all considered to be "new money", unlike those who came from Manhasset Neck or Cow Neck Peninsula, places which were home to many of New York's wealthiest established families, and which sat across a bay from Great Neck. This real-life juxtaposition gave Fitzgerald his idea for "West Egg" and "East Egg". In this novel, Great Neck (King's Point) became the new-money peninsula of "West Egg" and Port Washington (Sands Point) the old-money "East Egg". Several mansions in the area served as inspiration for Gatsby's home, such as Oheka Castle and the now-demolished Beacon Towers.
By mid-1923, Fitzgerald had written 18,000 words for his novel but discarded most of his new story as a false start, some of which resurfaced in the 1924 short story "Absolution".
Work on The Great Gatsby began in earnest in April 1924; Fitzgerald wrote in his ledger, "Out of woods at last and starting novel." He decided to make a departure from the writing process of his previous novels and told Perkins that the novel was to be a "consciously artistic achievement" and a "purely creative work — not trashy imaginings as in my stories but the sustained imagination of a sincere and yet radiant world." He added later, during editing, that he felt "an enormous power in me now, more than I've ever had." Soon after this burst of inspiration, work slowed while the Fitzgeralds made a move to the French Riviera where a serious crisis in their personal relationship soon developed. By August, however, Fitzgerald was hard at work and completed what he believed to be his final manuscript in October, sending the book to his editor, Maxwell Perkins, and agent, Harold Ober, on October 30. The Fitzgeralds then moved to Rome for the winter. Fitzgerald made revisions through the winter after Perkins informed him in a November letter that the character of Gatsby was "somewhat vague" and Gatsby's wealth and business, respectively, needed "the suggestion of an explanation" and should be "adumbrated".
Content after a few rounds of revision, Fitzgerald returned the final batch of revised galleys in the middle of February 1925. Fitzgerald's revisions included an extensive rewriting of Chapter VI and VIII. Despite this, he refused an offer of $10,000 for the serial rights in order not to delay the book's publication. He had received a $3939 advance in 1923 and $1981.25 upon publication.