It will be a sixth British and Team Sky victory in seven years in the three-week race and Thomas will be the first Welshman to win one of cycling's three Grand Tours.
Thomas successfully defended his lead of 1 minute, 51 seconds over second-placed Tom Dumoulin in the mostly ceremonial final stage.
Thomas ticked off the final mountain test on the Tour and snatched six bonus seconds to extend his lead in yellow as Sky team-mate Chris Froome slipped off the podium two days from Paris.
The Tour de France finishes tomorrow on the Champs Elysees in Paris.
Thomas's win was a surprise given Froome arrived in France as the team's leader, but it is another sign of their strength that even when the four-time champion faltered, the team did not.
"I really appreciate all the support - it's been a tough Tour at times but the support has outshone any negativity and that means a lot to all of us". Normally it's a really hard stage but I seemed to float around today. I encouraged him to get out and get it out of his system, in a way.
In Froome, Thomas saw innocence, fierce determination and huge talent.
"It has been a great race - if we look at all our individual riders they are unbelievable", Thomas, who won two mountain stages including one up the iconic Alpe d'Huez climb, told a news conference.
"I was the back-up leader and if I was good, I was good and I would stay in front".
Image Stage 21 brought the riders from Houilles to Paris Champs-Elysees
"It's insane. I just don't know what to think".
For years he had arrived in Paris as just another domestique in Sky's train, having served Froome or Bradley Wiggins, and there was no doubt he had earned his time to wear yellow.
Thomas, who now has another major honour to accompany his pair of Olympic gold medals on his mantlepiece, won the eleventh and twelfth stages in the Alps while continually picking up advantages elsewhere to accumulate a final time of 83 hours, 17 minutes and 13 seconds.
The Cardiff native who is also a three-time world champion in the team pursuit (2007, 2008 and 2012), has raced the Tour Down Under eight times - in 2007 and from 2011 to 2017 - often arriving early to spend extra weeks training in Australia. "I can't believe it", said Thomas on ITV4. "I didn't know anything about split times and I still thought Froome was one second ahead of me when I crossed the line".
"To win on Alpe d'Huez in the yellow jersey".
The team's dominance in recent years and Froome's positive test for excessive levels of the asthma drug Salbutamol (before subsequently being cleared of any wrong-doing) fuelled the crowds' anger.
This victory will come in his ninth Tour, one fewer than the record for most appearances before winning, held by 1980 victor Joop Zoetemelk of the Netherlands.
Tasmanian Richie Porte, one of the overall favourites, then crashed out for a second successive year on stage nine to Roubaix and before the first of 15 sectors of cobbles with a fractured collarbone.