The 26-year-old, whose previous deal was due to expire this summer, will now remain at Oakwell until at least the completion of the 2015 season.
"I am absolutely delighted to sign a new contract at Barnsley. There was never any doubt that I would be coming back," he told the club's official website.
"It's going to be a brilliant season again. It gets harder every year, there are strong Premier League teams coming down, but as you saw last year Wolves, Blackburn and Bolton all struggled in parts. It won't be an easy ride for the clubs that have been relegated this time either.
"I've still got it in my mind playing the top teams in the league last season and winning, and it shows we have got nothing to fear this season from any side. Since January we've made Oakwell like a fortress and if we can continue that form from last season we will do very well."
Cranie had previously been linked with a number of Championship clubs.