Federer, 37 and bidding for his 101st career title, received a walkover into the final, where he will play Dominic Thiem, a 7-6(3) 6-7(3) 6-4 victor over Milos Raonic in Saturday's only semi-final. The meeting between Nadal and Federer would have been their 39th in long rivalry and the first since 2017.
"I warmed up today and I felt that my knee was not good to compete at the level I needed to compete in semi-final," Spain's Nadal said in a statement. "It's tough for me to accept all these things that I'm going through in my career." Nadal said he would now return home to Mallorca and would not play in the upcoming Miami Open. He hopes to return at the Monte Carlo Masters, which begins April 14.
It was just the fifth time in Nadal's career that he had conceded a walkover, and the first to Federer. Federer, 37, will play either Milos Raonic or Dominic Thiem in the final, bidding for his 101st career title.
The knee had begun to bother Nadal in the second set of his 7-6(2) 7-6(2) victory over Karen Khachanov in the quarter-finals on Friday. Nadal had enjoyed a dominant week at Indian Wells, reaching the semi-finals without dropping a set.
"For me it is not about today only," the world number two said. "It's about what it means for me to have to pull out in a tournament that I love so much like this one, and in the semi-finals after playing well during the whole tournament. You can imagine that I can't be happy."
Nadal, who has struggled with knee injuries throughout his stellar career, was the second high-profile player to withdraw from the tournament. Last Sunday, Serena Williams retired from her match against Garbine Muguruza with what was described as a viral illness. (Reporting by Martyn Herman and Gene Cherry Editing by Ian Chadband.