Pehr Wilhelm Wargentin (Sunne parish, Jämtlands län 11 September 1717 (OS) – 13 December 1783), Swedish astronomer and demographer.
Wargentin was the son of the vicar of Sunne Wilhelm Wargentin (1670–1735) and his spouse Christina Aroselia, and the great grandson of Joachim Wargentin (1611–1682), a Lübeck-born burgher of Åbo (Turku) in Finland.
When Pehr Wargentin was 12 years old he observed a (total) lunar eclipse which would spark his lifelong interest in Astronomy. During his tenure at Frösö trivialskola (elementary school), his teacher deemed him advanced enough to continue directly to Uppsala University. However, Wargentin's father wanted him first to attend the gymnasium (secondary school) of Härnösand, which he did. According to his own account, Wargentin was unimpressed with the purely classical and theological curriculum and the lack of any education in the sciences and did not finish the fourth year.
In 1735, Wargentin matriculated as a student at the University of Uppsala, where he excelled. Olof Hiorter was one of his instructors. He graduated with the degree of filosofie magister (then the highest degree awarded in the Faculty of Arts) in 1743 and became a docent in astronomy in 1746 and an adjunct in 1748. He was called to Stockholm as secretary of the Royal Swedish Academy of Sciences in 1749 on the death of secretary Pehr Elvius, Jr., and stayed on this post until his death. Wargentin therefore became the first long-serving secretary of the Academy, which had been founded in 1739. He is seen as an important person in leading the Academy to its first golden era. Wargentin also became the first director of the founded by the Academy of Sciences on the initiative of his predecessor, Elvius, and completed in 1753. In 1756 Wargentin married Christina Magdalena Raab, a marriage that would produce three daughters until his wife's death due to a miscarriage in 1769. He was elected a Foreign Honorary Member of the American Academy of Arts and Sciences in 1781.