A source told ESPN's Josina Anderson the new contract is worth $20.3 million and includes $10 million in guaranteed money.
The deal keeps Goodwin under contract through the 2021 season.
"I definitely feel like this offense is good for me in the sense that it allows me to be a football player," Goodwin said. "It gives me an opportunity to be out there and make plays, and that's what you would want in a scheme and a system. It's not just targeting me. Everybody gets to shine. That's what's good about this offense. It's not just a one-man wrecking crew, not one guy just making it happen. It's a lot of guys getting an opportunity to make plays."
Goodwin, 27, had a breakout 2017 season with career highs in catches (56) and receiving yards (962) to go with two touchdowns. He was third in the NFL with 17.2 yards per catch, and he had two of his three 100-yard games after quarterback Jimmy Garoppolo was inserted as the starter.
"Having an opportunity to get better each week and play with my teammates and my coaches and to come together and get a few wins toward the end of the year was definitely a blessing," Goodwin said. "So for me to have that opportunity to go into next year and the next three years after it to continue some of the things that we kind of started is a true blessing."
Goodwin suffered a concussion -- his second of the season -- during the 49ers' Week 17 win over the Los Angeles Rams. He has had at least four concussions in his career.
"I was not scared at all, by any means," he said. "I know the game I play. It's tough. It's physical. Things like that happen at some point. The people in the stands were more scared than I was based on how it looked and me being unconscious for a few seconds. I'm blessed for the opportunity to be healthy and go into 2018 with new opportunities."
Goodwin also played through personal strife in 2017: His son died from complications during his wife's pregnancy and, five weeks later, Goodwin's father died in the days leading up to a game against the Tennessee Titans. Goodwin posted 10 receptions for 114 yards in that game. He won the team's Len Eshmont Award for inspirational and courageous play and the team's Ed Block Courage Award, given to the player who exemplified a commitment to sportsmanship and courage.
He was also tracked with the fastest speed by a wide receiver on any catch last season according to Next Gen Stats through SportRadar, running 21.68 mph on a 55-yard catch from C.J. Beathard against the Arizona Cardinals on Nov. 5.
A former Olympic long jumper, Goodwin has 105 catches for 1,702 yards and eight touchdowns in five NFL seasons with Buffalo and San Francisco.
Information from ESPN's Nick Wagoner and The Associated Press was used in this report.