The 24-year-old playmaker moves to the European champions on the back of an outstanding World Cup.
He scored two goals in as many minutes in the 7-1 semi-final rout of Brazil, en route to overcoming Argentina 1-0 in Sunday's final.
Kroos is due to be unveiled by his new employers at a press conference later today.
Real hailed their latest catch as "one of the most important players of the moment".
More From This Section
Kroos, whose contract with Bayern expired next season, sided with Real over alternative touted moves to the likes of Manchester United or Chelsea.
He arrives at the Santiago Bernabeu with 11 trophies already on his cv, Sunday's World Cup the jewel in a collection including the 2013 Champions League, Bundesliga titles and the Club World Cup.
He joined Bayern as a teenager in 2007, making his first team appearance at the age of 17. He became a regular after an 18-month loan spell at Bundesliga rivals Bayern Leverkusen.
The path from the World Cup to Spain could also see Monaco's Colombia hotshot James Rodriguez join Kroos at Real.
The World Cup's top scorer with six goals told Spanish sports daily Marca on Monday: "I'd jump at the chance of going to Real Madrid.