The 29-year-old centre-back, who was out of contract at Chelsea, has signed a four-year deal in the Spanish capital, Real announced.
In a statement on their official website, Madrid said Rudiger would be unveiled at a press conference at the club's training ground on June 20.
He is currently with the Germany squad for a series of UEFA Nations League matches, with Hansi Flick's team playing Italy away on Saturday and then taking on England and Hungary before facing Italy again on June 14.
Rudiger, who started his professional career at VfB Stuttgart, spent two seasons at Roma before joining Chelsea in 2017 for a reported £29 million ($36.4m).
In his time at Stamford Bridge, Rudiger notably won the FA Cup in 2018 and the Europa League in 2019, although he didn't play in the latter final.
He then helped Thomas Tuchel's side to win the Champions League last year.
"We bid farewell to Antonio Rudiger as he departs Stamford Bridge with his Chelsea contract expiring, bringing to a close his five trophy-filled years with the club," the London side said in a statement.
Rudiger joins a Real side who are fresh from winning the Champions League by beating Liverpool 1-0 in last weekend's final in Paris.
He will compete with Eder Militao, David Alaba and Nacho Fernandez for a slot in the heart of the Real defence.