In a letter White wrote in response to inquiries from readers, he described how he came to conceive of Stuart Little: "many years ago I went to bed one night in a railway sleeping car, and during the night I dreamed about a tiny boy who acted rather like a mouse. That's how the story of Stuart Little got started". He had the dream in the spring of 1926, while sleeping on a train on his way back to New York from a visit to the Shenandoah Valley. Biographer Michael Sims wrote that Stuart "arrived in [White's] mind in a direct shipment from the subconscious." White typed up a few stories about Stuart, which he told to his 18 nieces and nephews when they asked him to tell them a story. In 1935, White's wife Katharine showed these stories to Clarence Day, then a regular contributor to The New Yorker. Day liked the stories and encouraged White not to neglect them, but neither Oxford University Press nor Viking Press were interested in the stories, and White did not immediately develop them further.
In the fall of 1938, as his wife wrote her annual collection of children's book reviews for The New Yorker, White wrote a few paragraphs in his "One Man's Meat" column in Harper's Magazine about writing children's books. Anne Carroll Moore, the head children's librarian at the New York Public Library, read this column and responded by encouraging him to write a children's book that would "make the library lions roar". White's editor at Harper, who had heard about the Stuart stories from Katherine, asked to see them, and by March 1939 was intent on publishing them. Around that time, White wrote to James Thurber that he was "about half done" with the book; however, he made little progress with it until the winter of 1944-1945.