The Swiss legend will play in his 24th Grand Slam final where he will face either home favourite Andy Murray or Frenchman Jo-Wilfried Tsonga.
He also becomes the first man to reach eight finals at Wimbledon after this 6-3, 3-6, 6-4, 6-3 win.
‘Obviously, I’m ecstatic – I’m so happy,’ the six-time winner said afterwards.
‘I played a great match. It has been a tough tournament for me. I was able to play some fantastic tennis.’
His tactic of attacking Djokovic, who made an uncharacteristic number of unforced errors, and keeping points short paid off.
They traded blows early on, taking a set each, but it was not until the third set that the match really burst into life.
Federer wasted several break points in an enthralling second game, and put a crucial forehand wide with the last to miss his chance.
Djokovic, serving to stay in the set at 4-5, offered two set points after a wild smash – and Federer took the second of them following an incredible 18-shot rally.
The Swiss was again dominant in the fourth set, breaking Djokovic’s serve as he went 3-0 up.
And the Serb failed to deal with Federer’s superb serving and his title aspirations eventually disappeared as he went down 6-3.