Real will take on the Galicians of Celta Vigo and Barca will face Basque outfit Real Sociedad.
In the other ties, Atletico Madrid will meet a modest Eibar side who have reached the last eight for the first time while second division survivors Alcorcon go up against Alaves.
Real Madrid will take on Celta next Wednesday after putting out Sevilla, conquerors of Valencia.
Barcelona got past Athletic Bilbao after turning around a 2-1 first-leg deficit.
The first-leg games are on January 18 with the returns on January 25.
Real Sociedad v Barcelona
Alcorcon v Alaves
Atletico Madrid v Eibar
Real Madrid v Celta
Would you like to place a soccer bet? Click here to get started in 3 easy steps.