Raised in Australia and educated at Knox Grammar School, where he was dux in 1961, Pratt attended Sydney University, where he completed his masters thesis in 1970, related to what is now known as natural language processing. He then went to the United States, where he completed a Ph.D. thesis at Stanford University in only 20 months under the supervision of advisor Donald Knuth. His thesis focused on analysis of the Shellsort sorting algorithm and sorting networks.
Pratt was an assistant professor at MIT (1972 to 1976) and then associate professor (1976 to 1982). In 1974, working in collaboration with Knuth and Morris, Pratt completed and formalized work he had begun in 1970 as a graduate student at Berkeley; the coauthored result was the Knuth–Morris–Pratt pattern matching algorithm. In 1976, he developed the system of dynamic logic, a modal logic of structured behavior.
He went on sabbatical from MIT to Stanford (1980 to 1981), and was appointed a full professor at Stanford in 1981.
Pratt directed the SUN workstation project at Stanford from 1980 to 1982. He contributed in various ways to the founding and early operation of Sun Microsystems, acting in the role of consultant for its first year, then, taking a leave of absence from Stanford for the next two years, becoming director of research, and finally resuming his role as a consultant to Sun and returning to Stanford in 1985.
He also designed the Sun logo, which features four interleaved copies of the word "sun"; it is an ambigram.
Pratt became professor emeritus at Stanford in 2000.