How long does a PhD take?

According to the National Science Foundation’s 2021 Survey of Earned Doctorates, it took a median of 7.3 years to complete a PhD in the broad field of computer and information sciences. Time to completion varies according to research area; for example, PhDs in theoretical computer science typically take less time to complete than  PhDs in computer systems. Time to completion also varies with the candidate’s choice of research problem and advisor, funding source(s), and commitment to full-time study.