The news comes three days before Los Blancos resume their domestic campaign.
Ancelotti will head into a period of self isolation and is a doubt to take his place on the bench when Real Madrid visit Celta Vigo in La Liga this weekend.
Real Madrid will also visit Chelsea in the first leg of the UEFA Champions League quarter-final on Wednesday and Ancelotti could miss that too if he does not make an early recovery.
Ancelotti's son, Davide, who is Real Madrid's assistant manager, will take charge if the former Paris Saint Germain, AC Milan and Everton boss remains absent.
A statement on the club's website simply read: "Real Madrid confirm that our coach Carlo Ancelotti has tested positive for COVID-19."
Real Madrid are nine points clear at the top of the La Liga table but lost their last fixture 4-0 at home to Barcelona before the international break.
However, with just nine matches remaining, they will be expected to reclaim the title from Atletico Madrid come the end of the season.
Real Madrid will be looking to revenge last season's Champions League semi-finals defeat to Chelsea when the two sides meet again in the last eight this term.
But Ancelotti could miss the trip to his former club, where he won one Premier League title and an FA Cup in a two-year spell between 2009 and 2011.