The Ivorian defender had an injury-ravaged start to his Hammers career after he joined from Hamburg in the summer of 2011.
But the former Arsenal full-back battled back to fitness and has established himself as a first-team regular under Sam Allardyce.
"It's really good for me and I'm really happy to have a new deal with West Ham," said Demel, who has made 17 appearances so far this season.
"I've had a good year this season, and even last year was good, despite the fact that I was injured for so long and struggled a bit.
"I'm happy to be at West Ham and in the team. The lads are really good with me as are the people working for the club. I hope I will stay that long to play in the new stadium as well."