The book was written between 1959 and 1960. L'Engle wrote repeatedly about the writing of the story and the long struggle to get it published. In A Circle of Quiet (1972), she explains that the book was conceived "during a time of transition". After years of living in rural Goshen, Connecticut and running a general store, L'Engle's family, the Franklins, moved back to New York City, first taking a ten-week camping trip across the country and back again. L'Engle writes that "we drove through a world of deserts and buttes and leafless mountains, wholly new and alien to me. And suddenly into my mind came the names, Mrs Whatsit. Mrs Who. Mrs Which." This was in the spring of 1959. L'Engle was reading about quantum physics at the time, which also made its way into the story. When she completed the book in early 1960, however, it was rejected by at least 26 publishers, because it was, in L'Engle's words, "too different", and "because it deals overtly with the problem of evil, and it was really difficult for children, and was it a children's or an adults' book, anyhow?"
In "A Special Message from Madeleine L'Engle" on the Random House website, L'Engle explains another possible reason for the rejections: "A Wrinkle in Time had a female protagonist in a science fiction book," which at the time was uncommon. After trying "forty-odd" publishers (L'Engle later said "twenty-six rejections"), L'Engle's agent returned the manuscript to her. Then at Christmas, L'Engle threw a tea party for her mother. One of the guests happened to know John C. Farrar of Farrar, Straus and Giroux, and insisted that L'Engle should meet with him. Although the publisher did not at the time publish a line of children's books, Farrar met L'Engle, liked the novel, and ultimately published it.
The book has been continuously in print since its first publication. The hardback edition is still published by Farrar, Straus & Giroux. The original blue dust jacket by Ellen Raskin was replaced with new art by Leo and Diane Dillon, with the publication of A Swiftly Tilting Planet in 1978. The book has also been published in a 25th anniversary collectors' edition (limited to 500 signed and numbered copies), at least two book club editions (one hardback, one Scholastic Book Services paperback), as a trade paperback under the Dell Yearling imprint, and as a mass market paperback under the Dell Laurel-Leaf imprint. The cover art on the paperback editions has changed several times since first publication.
The book was reissued by Square Fish in trade and mass market paperback formats in May 2007, along with the rest of the Time Quintet. This new edition includes a previously unpublished interview with L'Engle as well as the text of her Newbery Medal acceptance speech.