After Kerouac dropped out of Columbia University he served on several different sailing vessels before returning to New York to write. He met and mixed with Beat Generation figures Allen Ginsberg and William Burroughs, and Neal Cassady, who would become Dean Moriarty. Between 1947 and 1950, while writing what would become The Town and the City, Kerouac engaged in the road adventures that would form On the Road. Kerouac carried small notebooks, in which much of the text was written as the eventful span of road trips unfurled. He started working on the first of several versions of the novel as early as 1948, based on experiences during his first long road trip in 1947. However, he remained dissatisfied with the novel. Inspired by a thousand-word rambling letter from his friend Neal Cassady, Kerouac in 1950 outlined the "Essentials of Spontaneous Prose" and decided to tell the story of his years on the road with Cassady as if writing a letter to a friend in a form that reflected the improvisational fluidity of jazz. In a letter to a student in 1961, Kerouac wrote: "Dean and I were embarked on a journey through post-Whitman America to FIND that America and to FIND the inherent goodness in American man. It was really a story about 2 Catholic buddies roaming the country in search of God. And we found him."
The first draft of what was to become the published novel was written in three weeks in April 1951 while Kerouac lived with Joan Haverty, his second wife, at 454 West 20th Street in Manhattan, New York. The manuscript was typed on what he called "the scroll"—a continuous, one hundred and twenty-foot scroll of tracing paper sheets that he cut to size and taped together. The roll was typed single-spaced, without margins or paragraph breaks. In the following years, Kerouac continued to revise this manuscript, deleting some sections (including some sexual depictions deemed pornographic in the 1950s) and adding smaller literary passages. Kerouac authored a number of inserts intended for On the Road between 1951 and 1952, before eventually omitting them from the manuscript and using them to form the basis of another work, Visions of Cody. On the Road was championed within Viking Press by Malcolm Cowley and was published by Viking in 1957, based on revisions of the 1951 manuscript. Besides differences in formatting, the published novel was shorter than the original scroll manuscript and used pseudonyms for all of the major characters.
Viking Press released a slightly edited version of the original manuscript on 16 August 2007 titled On the Road: The Original Scroll corresponding with the 50th anniversary of original publication. This version has been transcribed and edited by English academic and novelist Dr. Howard Cunnell. As well as containing material that was excised from the original draft due to its explicit nature, the scroll version also uses the real names of the protagonists, so Dean Moriarty becomes Neal Cassady and Carlo Marx becomes Allen Ginsberg, etc.
In 2007, Gabriel Anctil, a journalist of the Montreal's daily Le Devoir discovered, in Kerouac's personal archives in New York, almost 200 pages of his writings entirely in Quebec French, with colloquialisms. The collection included ten manuscript pages of an unfinished version of On the Road, written on January 19, 1951. The date of the writings makes Kerouac one of the earliest known authors to use colloquial Quebec French in literature.
The original scroll of On The Road was bought in 2001 by Jim Irsay (Indianapolis Colts football team owner) for $2.43 million. It has occasionally been made available for public viewing, with the first 30 feet (9 m) unrolled. Between 2004 and 2012, the scroll was displayed in a number of museums and libraries in the United States, Ireland, and the UK. It was exhibited in Paris during the 2012's summer to celebrate the movie based on the book.