The extension includes a club option of $14.5 million in 2018.
Goldschmidt said he loves it in Arizona and doesn't want to play anywhere else.
"I couldn't be happier," Goldschmidt said at a news conference at Chase Field, where Arizona opens its season Monday against the St. Louis Cardinals.
Goldschmidt took hold of the starting first base job last season and batted .286 with 20 home runs, 82 RBIs and a .359 on-base percentage in 145 games.
Arizona has locked up several players to extensions in the last year, among them catcher Miguel Montero, second baseman Aaron Hill and also Martin Prado, who was acquired from Atlanta as part of an offseason trade for outfielder Justin Upton.
Before Friday night's exhibition game against Cincinnati at Chase Field, manager Kirk Gibson was gushing in his praise for Goldschmidt and his approach to the game.
"What's not to like," Gibson said. "I mean, everything he does from the time he gets to the park until the time he leaves every day. He's very good at preparation, before, during the game, after, a great teammate, works really hard. He has high aspirations to be a world champion. He wants to win a Gold Glove. And he would never change. It will never change until he stops playing. We talked about the 'Diamondback way' the last couple of year and he's a model of a Diamondback guy."
Goldschmidt said he was happy to get the deal done before the start of the season.
"I'm excited we got this done, especially before the start of the year," Goldschmidt said. "It does make it so it's one less thing to worry about."
The 25-year-old first baseman shot through the Arizona minor league system after he was drafted in the eighth round out of Texas State in 2009.
"Probably a lot of people didn't give him much of a shot based on where he was drafted," general manager Kevin Towers said, "and all he did was prove people wrong all the way through the minor leagues. They said he couldn't play defense and he ended up being, I think, one of the better defenders at first base in our league."
The 6-foot-3, 245-pound player came to the majors during the 2011 season, batting .250 in 58 games, then burst into prominence in the NL Division Series against Milwaukee, when he became the second rookie in baseball history to homer in his first two playoff games. His grand slam against Milwaukee was the third by a rookie in the postseason. Goldschmidt hit .438 in the five-game loss to the Brewers.
After batting just .213 in the first 27 games of last season, he hit .303 the rest of the way.
Among NL first basemen in 2012, Goldschmidt ranked second in batting average, second in doubles, third in slugging percentage (.497), third in hits (147), fourth in home runs and fourth in RBI.
Without the new contract, Goldschmidt would be eligible for salary arbitration after the 2014 season and for free agency after the 2017 World Series.
Information from The Associated Press was used in this report.