Real Madrid's Carvajal, who has recovered from a hamstring injury suffered in the Champions League final win over Liverpool, replaces Nacho at right-back for the Group B clash in Kazan.
Nacho scored a stunning goal in a 3-3 draw with Portugal last week but also conceded a penalty that Cristiano Ronaldo converted on his way to a hat-trick.
Lucas Vazquez, also at Real, comes in on the right side of midfield in place of Atletico Madrid's Koke to join Isco and David Silva in support of striker Diego Costa, who scored twice against Portugal.
Iran coach Carlos Queiroz has had to reshuffle his starting 11 following injury to Roozbeh Cheshmi.
Iran began their campaign with a 1-0 win against Morocco but Queiroz has admitted they will have to produce their "best game ever" if they are to fulfil their aim of causing an almighty World Cup upset.
Teams for the World Cup Group B match between Iran and Spain at Kazan Arena on Wednesday (1800 GMT):
Ali Beiranvand; Ramin Rezaeian, Morteza Pouraliganji, Majid Hosseini; Ehsan Haji Safi (capt), Saeid Ezatolahi, Omid Ebrahimi, Vahid Amiri, Karim Ansarifard, Mehdi Taremi, Sardar Azmoun
Coach: Carlos Queiroz (POR)
David de Gea; Dani Carvajal, Gerard Pique, Sergio Ramos (capt), Jordi Alba; Sergio Busquets, Andres Iniesta; Lucas Vazquez, David Silva, Isco; Diego Costa
Coach: Fernando Hierro (ESP)
Andres Cunha (URU)