Joshua, 33, knocked out Whyte in the seventh round of their heated British title fight eight years ago, which also took place at the O2, avenging a loss to his rival in the amateurs.
Olympic gold medallist Joshua went on to become a two-time world champion.
Whyte, 36, lost his only world title challenge to Tyson Fury in 2022.
“I’ve been clear that my plan is to be active this year,” said Joshua. “August 12 is the date – I’ll be ready to fight. I look forward to dealing with business.”
Whyte beat Joshua by decision as an amateur in 2009, forming the basis of their bitter rivalry.
Joshua gained revenge when the pair met again as professionals in December 2015. ‘AJ’ was rocked in the second round but recovered to force a stoppage in the seventh.
“I’m looking forward to returning to the London O2 on August 12 and going to war,” said Whyte. “It’s 1-1, so this is the decider.”
Joshua beat American Jermaine Franklin on points in April, his first win in more than two years, having lost consecutive bouts to WBA (Super), IBF and WBO world champion Oleksandr Usyk.
The Londoner – who has won 25 fights and lost three – turned professional after winning gold at London 2012.
He won a world title in his 16th fight, but suffered his first professional loss in a shock stoppage defeat by Andy Ruiz Jr at Madison Square Garden in June 2019, before reclaiming his unified titles on points in the rematch six months later.
Joshua is expected to face former world champion Deontay Wilder in December in Saudi Arabia, with a deal reportedly close to being agreed.
It is understood he wanted a second fight under the tutelage of trainer Derrick James before taking on hard-hitting American Wilder.
After weeks of negotiations, and Joshua and promoter Eddie Hearn accepting Whyte’s request to remove a rematch clause, the fight has been agreed.
“I can’t quite believe this fight is happening and there was absolutely no stopping either man,” Hearn said.
“The rivalry runs deep and there is something about these two where they will never back down from each other.
“It is an absolute must-win for both. Get ready for fireworks.”