Roberts arrived at Oxford in 1943 and graduated in 1947 with Second-Class Honours, in the four-year Chemistry Bachelor of Science degree, specialising in X-ray crystallography under the supervision of Dorothy Hodgkin. Her dissertation was on the structure of the antibiotic gramicidin. Roberts did not only study chemistry as she intended to be a chemist only for a short period of time, already thinking about law and politics. She was reportedly prouder of becoming the first prime minister with a science degree than becoming the first female prime minister. While prime minister she attempted to preserve Somerville as a women's college.