The new deal will extend both players existing contracts for another two years with NZR and the Crusaders in Super Rugby Pacific, with the duo also aligned with their respective provincial unions in the NPC for the same period, Barrett with Taranaki, and Taylor with Canterbury.
Barrett is a leading candidate to be named the next All Blacks captain under new coach Scott Robertson.
"Representing my club and country has always been a privilege and to have the opportunity to put my hand up for another World Cup cycle was a big motivation," Barrett said.
"It's great to have certainty for myself, Hannah, and our young son, and we're excited about the next chapter."
Barrett, 30, has played 69 Tests since his debut against Ireland in 2016 and has 117 caps for the Crusaders where he's led the team to four Super Rugby titles since taking on the captaincy in 2020.
Taylor said extending his time with NZR had been an easy decision.
"Having the opportunity to play through another World Cup cycle and pull on the jerseys I love for a few more years is awesome. I'm grateful to New Zealand Rugby for allowing me to take a break this year as part of my last contract, and I'm feeling rejuvenated and excited about what's to come.
"My wife Lucy and I are really settled in Christchurch with our young family, and it was an easy decision to remain here in New Zealand."
Taylor, 33, has amassed 85 Test caps since his debut against Argentina in 2015 and scored 20 tries during a career that's included a Rugby World Cup winners medal in 2015 and 134 caps for the Crusaders since his Super Rugby debut in 2013.
All Blacks Head Coach Scott Robertson said having two of New Zealand's most experienced senior players was significant for the game.
"Scott and Codie bring leadership, talent, and energy to the teams they represent, but their positive influence goes beyond what they do on the field. They drive high standards every day and inspire those around them through their actions.
"Scott's one of the most tactically astute players in the game and holds the respect and mana of his team mates and coaches, and Codie's dedication to his craft is evident every time he steps on the field. To have them both recommit to the end of 2027 is great news for New Zealand rugby."
Crusaders coach Rob Penney is thrilled with the news.
"To have players like that in our environment, and to be committed to who we are and what we are trying to do, is huge for us. Scooter [Barrett] has been a pillar among our team for many years. People look to him for guidance and strength, and he is always there for the team. He embodies the idea of playing for each other, and we are very pleased to see him recommit to the red and black.
"Codie has been a career veteran for this team... and we're very lucky to have him with us for another few years. He's a huge presence and drives us forward both on and off the field."