Danish driver Kevin Magnussen was dropped after one season and will be the team's test and reserve driver.
Alonso's departure from Ferrari after five seasons and return to his former team was widely expected. The Spanish driver, a two-time champion, had already been replaced at Ferrari by four-time champion Sebastian Vettel.
Alonso said McLaren's reunion with the Honda engine — a combination that ruled F1 between 1988-92 — was a key factor in his decision.
"Let the legend return: That is our challenge," Alonso said in a statement.
It was a straight choice between Button and Magnussen to be McLaren's other driver, with the Briton retained after outscoring Magnussen 126-55 in the 2014 season.
Button, who won the driver's title in 2009 with Brawn, heads into his sixth year with McLaren and 16th year in F1 — making him the most experienced driver on the grid.
The 34-year-old Button was out of contract and the uncertainty over his future at McLaren had opened his eyes to other possibilities, with speculation he could join former F1 driver Mark Webber on the World Endurance Championship or drive in the Le Mans 24 Hours.
"I am very much looking forward to having a driver as fast and as experienced as Fernando as my teammate," said Button, who was also runner-up to Vettel in 2011. "I am sure we will work extremely well together."
McLaren was the final team to announce its driver lineup for 2015. It did not reveal the length of the contracts handed to Alonso and Button.
"Fernando and Jenson have started a combined total of precisely 500 grands prix between them — a mighty aggregate — and have won 47 of them," said Ron Dennis, McLaren's chairman and chief executive. "I can safely say, therefore, that we now have by an order of magnitude the best driver lineup of any current Formula 1 team."
Alonso will look to revive his career after finishing sixth in last season's drivers' championship as Ferrari had its worst season in 21 years. He left McLaren at the end of 2007 after a breakdown in relations with Dennis, who was team principal at the time.
The BBC reported that Alonso's deal is worth $40 million a year, which would make him the best-paid driver on the grid.
"I am joining this project with enormous enthusiasm and determination, knowing that it may require some time to achieve the results we are aiming for, which is no problem for me," said Alonso, who added that he was contacted by McLaren more than a year ago.
The McLaren-Honda partnership brought the team eight titles (drivers and constructors) and 44 victories in 80 races between 1988 and '92.