White's editor Ursula Nordstrom said that one day, in 1952, E.B. White handed her a new manuscript, the only version of Charlotte's Web then in existence, which she read soon after and enjoyed. Charlotte's Web was published three years after White began writing it.
Since E. B. White published Death of a Pig in 1948, an account of his own failure to save a sick pig (bought for butchering), Charlotte’s Web can be seen as White's attempt "to save his pig in retrospect". White's overall motivation for the book has not been revealed and he has written: "I haven't told why I wrote the book, but I haven't told you why I sneeze, either. A book is a sneeze".
When White met the spider who originally inspired Charlotte, he called her Charlotte Epeira (after Epeira sclopetaria, the Grey Cross spider, now known as Aranea sericata), before discovering that the more modern name for that genus was Aranea. In the novel, Charlotte gives her full name as "Charlotte A. Cavatica", revealing her as a barn spider, an orb-weaver with the scientific name Araneus cavaticus.
The arachnid anatomical terms (mentioned in the beginning of chapter nine) and other information that White used, came mostly from American Spiders by Willis J. Gertsch and The Spider Book by John Henry Comstock, both of which combine a sense of poetry with scientific fact. White incorporated details from Comstock's accounts of baby spiders, most notably the "flight" of the young spiders on silken parachutes. White sent Gertsch’s book to illustrator Garth Williams. Williams’ initial drawings depicted a spider with a woman’s face, and White suggested that he simply draw a realistic spider instead.
White originally opened the novel with an introduction of Wilbur and the barnyard (which later became the third chapter), but decided to begin the novel by introducing Fern and her family on the first page. White’s publishers were at one point concerned with the book’s ending and tried to get White to change it.
Charlotte's Web has become White's most famous book; but White treasured his privacy and that of the farmyard and barn that helped inspire the novel, which have been kept off limits to the public according to his wishes.