John, who made his full international debut for Wales in a FIFA World Cup qualifier against Macedonia in October, has come through the youth system at the South Wales outfit and started the club's first Premier League game of the season at West Ham.
He has since made two League Cup appearances and Cardiff manager Malky Mackay is delighted the 18-year-old has committed his future to the club.
"Declan has done extremely well and is thoroughly deserving of his new contract at Cardiff City Football Club," said Mackay.
"In addition, we are delighted to have secured his talent on a long-term basis. He's a fine young man, disciplined and professional, who will continue working hard as part of our Premier League squad.
"I've no doubt that Declan is going to have a big future with us and for his country."
John will hope to be involved in the Cardiff squad that travels to face Stoke City on Wednesday.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.