He will be replacing Dominic Treadwell-Collins who has been in charge for the past two and a half years.
Under his reign, EastEnders saw the arrival of the Carter family - with Danny Dyer and Kellie Bright - and the Who Killed Lucy Beale? plot.
O'Connor takes over from Treadwell-Collins in the late spring.
Before he leaves, Treadwell-Collins will oversee Dame Barbara Windsor's final episodes as Peggy Mitchell and the return of Peggy's son Grant, played by Ross Kemp.
Treadwell-Collins said: "After two and a half years of giving my blood to Walford, it is time for me to move on to other things - and keep EastEnders creatively refreshed, something that it has to do to stay at the top of its game.
"I made the decision to leave back in the summer, but decided to stay longer for two reasons. Firstly, to oversee Peggy's last episodes, which will air in May. When Dame Barbara comes to you to produce her final episodes, you cannot say no...
"Secondly, I needed to find the right person to take over from me. This is an incredible all-consuming show, and in Sean, I know that we have found someone who already has Albert Square in his bones and who adores EastEnders as much as I do."
O'Connor, who joined The Archers as editor in September 2013, returns to EastEnders after an 11-year gap, having previously worked on the programme as director, producer and story producer.
His storylines included the big reveal Kat Slater was Zoe Slater's mother and not her sister, the domestic violence storyline between Little Mo and Trevor and the courtship of Dot Cotton and Jim Branning.
"Dominic hands over EastEnders in robust health," he said. "It's a testament to his endless commitment, infectious enthusiasm and rich imagination that the programme remains BBC One's flagship drama.
"I'm thrilled to be back in Walford and particularly delighted to work once more with many dear friends and colleagues both backstage and on screen."
Sean O'Connor, the editor of long-running Radio 4 soap The Archers, is taking over as executive producer on BBC One's EastEnders.