The actress - who left the show in 2010 - said she's "thrilled" to be playing a part in the anniversary celebrations.
The week of special shows in February will include a 30-minute live episode.
Viewers last saw Peggy make a surprise appearance in September to voice her disagreement with son Phil's impending marriage to Sharon Rickman.
Producers said the show could not celebrate the anniversary without one of the soap's "most iconic characters" and "legendary landladies".
"I am absolutely thrilled that Peggy has been included in the celebrations to mark the 30th anniversary of EastEnders," said Windsor.
"What an incredible achievement for all the production, cast and crew, past and present."
Windsor became one of the show's most popular characters after joining EastEnders as the Queen Vic landlady in 1994.
"Barbara and Peggy are intrinsically linked with EastEnders and when we planned our explosive anniversary episodes, Peggy was the first name on our list of hoped-for returns," said executive producer Dominic Treadwell-Collins.
"Barbara has not only created one of EastEnders' most iconic characters but she's also hugely loved and missed by everyone here.
"We couldn't celebrate 30 years of EastEnders without Barbara Windsor."
Since leaving EastEnders Windsor has appeared in pantomime and presented several shows for BBC Radio 2.
The special "live week" kicks off on Monday 16 February, with a live element being integrated into every episode as well as a 30-minute fully live episode.
EastEnders first aired on BBC One on 19 February 1985.
Barbara Windsor will return to EastEnders to reprise the role of Peggy Mitchell for one of the soap's 30th anniversary specials next year.