The right-back missed most of last season through injury but is still regarded as the undisputed first choice in his position.
Carvajal joins Luka Modric (until 2022), Lucas Vazquez (until 2024) and Nacho (until 2023) in penning a new deal this summer.
The next on the list for Los Blancos is Karim Benzema, who is expected to sign a contract until 2023.
Carvajal has been with the club for more than 20 years, joining La Fabrica as a youngster before moving up to the first team in the 2013/14 season under Carlo Ancelotti.
Since then he has been the undisputed starter at right-back in the eight seasons he has been in the first team, and a protagonist of Madrid’s golden era where the club won four Champions League titles in five years.