Federer, a four-time champion in the California desert, will take on 17th-seeded American Jack Sock, who toppled fourth-seeded Kei Nishikori of Japan 6-3, 2-6, 6-2.
"Unfortunately I am unable to play today due to sickness," Kyrgios said on Twitter. "At this stage we think it's food poisoning, and I'm praying it's nothing more."
Kyrgios had been due to face Federer after knocking out Novak Djokovic in the last 16 on Wednesday.
The Australian's illness is a cruel twist of fate for the talented 21-year-old, who has shown signs of finally starting to deliver on his promise in recent weeks after a young career marked by controversy.
Also Read
In his statement on Friday, the world number 16 said he had taken the decision to pull out in California with a heavy heart.
"After a restless night of being sick I have nothing left and to play a great champion like Roger I need to be at my best to have a chance," Kyrgios said.
"I don't take this decision lightly, these are the matches we train for, but I'm in no fit state to take to the court," he added.
Federer, meanwhile, tweeted his support to the Australian youngster.
"Hope you feel better @NickKyrgios," said the Swiss ace, who took the court briefly on Friday to speak to disappointed fans.
"I was actually really looking forward to the match," said Federer, who had looked sharp in a 6-2 6-3 dismantling of Rafael Nadal in the fourth round -- a reprise of his thrilling five-set victory over his old foe in the Australian Open final.
Federer's 18th Grand Slam title in January came after a frustrating 2016 campaign marred by injury.
"To be back on court feeling normal again is so nice, you feel just happy and fresh and I think it translates also to my game. I can play freely, take chances like I have nothing to lose -- it might be one of the first times in a long, long time I feel this way."
- Big win for Sock -
====================
That could be bad news for Sock, whose victory over fifth-ranked Nishikori was his first career win over a top-five player.
But he's had to battle to get this far in Indian Wells, where he saved four match points against Grigor Dimitrov in the third round and was two points away from defeat against Malek Jaziri in the fourth.
Disclaimer: No Business Standard Journalist was involved in creation of this content