Victory on Sunday will take him level with Sampras's record of seven Wimbledon wins, reclaim the world No 1 ranking and clinch a 17th career Grand Slam crown.
'Lot on line' for Federer in Wimbledon final
The Swiss maintained his record of never losing a Wimbledon semi-final to reach a record eighth showpiece match at the All England Club with a dominant performance under a closed Centre Court roof.
After the first two sets were shared in less than an hour, the match came alive in the third set. Serving at 4-5 Djokovic blazed a smash long at 15-30 to give Federer two set points.
Djokovic saved the first with a forehand but Federer seized his chance, winning a sensational 20-stroke rally with a smash to move within a set of the final.
Djokovic could not recover and dropped serve early in the fourth set as Federer rolled to his first final at the grass-court slam since he beat Andy Roddick in 2009.
Federer held his nerve when he served for the match, sealing it after two hours and 19 minutes of high-octane action when Djokovic netted a forehand return.
"I'm ecstatic, I'm so happy," Federer said immediately after walking off court to huge applause.
"I played a great match today and it's been a tough tournament for me really.
"But I was able to play some fantastic tennis today and I thought Novak played good, too.
"The first two sets went really quickly and then the third set was really key and I managed to step it up and maybe get a bit lucky because he also had break points near the end of the third. It was a lot of fun out there today."
Looking ahead to a final against Andy Murray, Federer said: "I have a tough task ahead of me, there's a lot on the line because I can get all-time grand slam record and world No 1 so I have pressure but I'm excited about it."
Federer will return to the top of the world rankings if he equals Pete Sampras's seven Wimbledon titles tomorrow.
It would also mean he matches the American's 286 weeks spent as world No.1.
"He played well," Djokovic said.
"No question about it, he was the better player. In the important moments, he was aggressive, hitting from both sides.
"That's what you expect when you play against Roger in the final four of a grand slam. I expected him to be top level, but expected that of myself as well. I wasn't consistent and had ups and downs throughout.
"Unfortunately the one [down] that lasted for 15-20 minutes at the end of the third, beginning of the fourth, cost me the win today."
Follow us @SprtNationalUAE