It’s everyone’s favorite boy wizard’s birthday! Harry Potter was born on July 31, but it might surprise some to realize that he is turning 40 this year.

Though Warner Bros.’ “Harry Potter” films avoided stating an exact year, J.K. Rowling’s books established a timeline set in the real world. Harry starts Hogwarts after his 11th birthday on July 31, 1991, meaning that he was born in 1980. In 2020, he turns 40 years old.

Though “Harry Potter and the Sorcerer’s Stone” wasn’t published until 1997, Rowling started writing the story in 1990, which makes the timeline of Harry’s journey make a little more sense. Still, the series took much longer than an education at Hogwarts. She didn’t finish “Harry Potter and the Deathly Hallows” until 2007 when Harry would’ve been 27.

The books followed Harry from age 11 to 17, but the epilogue of Harry Potter takes place 19 years later, making Harry 36. However, he ages even further in “Harry Potter and the Cursed Child,” the play that follows his son Albus Severus in his first four years at Hogwarts. Though never mentioned, the later events of the play would take place in 2020.

Harry Potter is aging, and so is his portrayer, Daniel Radcliffe. The actor turned 31 on July 23, and he’s well-aware of the fact that people don’t like to see him age.

“I've come to accept that I'm forever going to be an awful yardstick of how old everyone is,” he told Busy Philipps on “Busy Tonight” in 2019. “I now have that effect on other people where I just depress people by the sight of me.”

Rowling shares Harry’s July 31 birthday. She turns 55 this year.

Harry Potter Daniel Radcliffe is pictured in “Harry Potter and the Sorcerer’s Stone.” Photo: Warner Bros.