Hofstadter was born into a Jewish family in New York City on February 5, 1915, to Polish immigrants, Louis Hofstadter, a salesman, and the former Henrietta Koenigsberg. He attended elementary and high schools in New York City and entered City College of New York, graduating with a B.S. degree magna cum laude in 1935 at the age of 20, and was awarded the Kenyon Prize in Mathematics and Physics. He also received a Charles A. Coffin Foundation Fellowship from the General Electric Company, which enabled him to attend graduate school at Princeton University, where he earned his M.S. and Ph.D. degrees at the age of 23. He did his post-doctoral research at the University of Pennsylvania and was an assistant professor at Princeton before joining Stanford University. Hofstadter taught at Stanford from 1950 to 1985.