On 29 August 2014, Alonso moved to Bayern Munich on a two-year deal for an undisclosed fee.
He made his debut the following day, starting in a 1–1 draw at Schalke 04.
On 27 September 2014, in the match against 1.
FC Köln, Alonso broke the record for most passes completed in a Bundesliga game, with 196.
He scored his first goal for the club on 18 October 2014, a free kick in a 6–0 win over Werder Bremen.

On 17 February 2015, in his 100th Champions League appearance, Alonso was sent-off for a second bookable offense in a 0–0 draw against Shakhtar Donetsk.
Alonso was suspended for the return leg of the fixture, which Bayern won 7–0.
Alonso would go on to record his fourth goal, another free kick, against Porto in the Champions League quarter-final.
Bayern would go on to win 6–1, advancing to the semi-finals for a fourth-straight season on aggregate, 7–4.

On 28 April 2015, Alonso was one of four Bayern players, all FIFA World Cup winners, to miss in a 2–0 penalty shootout defeat to Borussia Dortmund in the DFB-Pokal semi-final.
He was also the only player to miss as the club lost the shootout at the end of the 2015 DFL-Supercup away to VfL Wolfsburg, his attempt being saved by goalkeeper Koen Casteels.

On 18 December 2015, Alonso signed a new contract with Bayern, keeping him at the club until 2017.
On 9 March 2017, Alonso confirmed via Twitter his retirement from the game at the end of the 2016–17 season.

On 20 May 2017, Alonso and teammate, Bayern captain Philipp Lahm played their final professional game, in a 4–1 victory at home to Freiburg in which he assisted the opening goal for Arjen Robben.
He was substituted off in the 82nd minute for Franck Ribéry.
It was his 79th match in the German top-flight.
On 29 August 2014, Alonso moved to Bayern Munich on a two-year deal for an undisclosed fee. He made his debut the following day, starting in a 1–1 draw at Schalke 04. On 27 September 2014, in the match against 1. FC Köln, Alonso broke the record for most passes completed in a Bundesliga game, with 196. He scored his first goal for the club on 18 October 2014, a free kick in a 6–0 win over Werder Bremen.
On 17 February 2015, in his 100th Champions League appearance, Alonso was sent-off for a second bookable offense in a 0–0 draw against Shakhtar Donetsk. Alonso was suspended for the return leg of the fixture, which Bayern won 7–0. Alonso would go on to record his fourth goal, another free kick, against Porto in the Champions League quarter-final. Bayern would go on to win 6–1, advancing to the semi-finals for a fourth-straight season on aggregate, 7–4.
On 28 April 2015, Alonso was one of four Bayern players, all FIFA World Cup winners, to miss in a 2–0 penalty shootout defeat to Borussia Dortmund in the DFB-Pokal semi-final. He was also the only player to miss as the club lost the shootout at the end of the 2015 DFL-Supercup away to VfL Wolfsburg, his attempt being saved by goalkeeper Koen Casteels.
On 18 December 2015, Alonso signed a new contract with Bayern, keeping him at the club until 2017. On 9 March 2017, Alonso confirmed via Twitter his retirement from the game at the end of the 2016–17 season.
On 20 May 2017, Alonso and teammate, Bayern captain Philipp Lahm played their final professional game, in a 4–1 victory at home to Freiburg in which he assisted the opening goal for Arjen Robben. He was substituted off in the 82nd minute for Franck Ribéry. It was his 79th match in the German top-flight.
Xabi Alonso