O'Neill spent a large chunk of last season on loan at York City, making 16 appearances for the League Two side and scoring one goal.
The defender was recalled by Burnley for the FA Cup trip to Southampton at the start of the year before joining Southend on a 30-day emergency loan.
A thigh injury cut short O'Neill's stay at Roots Hall but the 22-year-old is now looking forward to regaining his fitness in pre-season training.
"I'm delighted to have signed a new deal and that the gaffer has given me the chance to be here for another two years," O’Neill told Burnley's website.
"I'm looking to get fit now after the injury I sustained whilst I was at Southend last season.
"Sean (Dyche, manager) saw fit to send me out on loan to get some more games under my belt and now I’m back here looking to play and compete.
"I know that will be hard now that we're in the Premier League but if not, then I will be looking to go out on loan again if that is something the gaffer wants me to do.
"I'm happy to be back here with a great group of lads and I’m thoroughly looking forward to pre-season."