Williams needed only 59 minutes to rout her Russian rival, improving to 20-2 all-time against Sharapova with her 19th consecutive victory in the rivalry.
"Whenever I play her I bring out some of my best tennis," Williams said. "She's such a good player. When you play her you have to be super focused."
Williams, who next plays 121st-ranked US wildcard Caty McNally, blasted five aces and 16 winners while Sharapova made 20 unforced errors in the loss at Arthur Ashe Stadium.
The 37-year-old American, seeking her seventh US Open title, is chasing the all-time record of 24 Slam singles titles won by Margaret Court.
Sharapova, the 2006 US Open winner who defeated Williams in the 2004 Wimbledon final, upset Simona Halep in the first round two years ago but could not revive that magic in the showcase opening-night match in the year's final Grand Slam tournament.
Williams said that once she learned she would face Sharapova in her first match, "every practice after that was super focused and super intense."
Eighth-seeded Williams broke for a 3-1 edge when Sharapova netted a backhand, again to 5-1 and took the first set in 24 minutes on a net cord winner.
Williams broke to open the second set then denied Sharapova on two break points to hold in the fifth game, an impressive backhand winner and a service winner ending the threat.
"That was definitely a big point for me," Williams said. "You can't let her get any momentum. I was really excited I hit that winner. It was a fun match."
Williams broke again to 4-1, rescued three break points in the sixth game to hold serve and broke again to advance, showing no sign of the back spasms that limited her pre-Open play.
"The body is good," she said. "My back is a lot better. I'm excited. This is going to be fun."
It was the first match for Williams at Ashe since she unleashed her wrath at umpire Carlos Ramos in last year's US Open final and he awarded a game penalty to eventual winner Naomi Osaka. Ramos will not officiate any Williams match at this year's US Open.
"I've had a lot of tough matches and a lot of tough losses but coming out here tonight makes it all worthwhile," Williams said in thanking the crowd, which included such celebrities as Spike Lee and Mike Tyson.
- Barty, Pliskova advance -
Swiss third seed Roger Federer, a 20-time Grand Slam winner, meets Indian qualifier Sumit Nagal later.
Top-ranked defending champion Novak Djokovic cruised into the second round while French Open champion Ashleigh Barty and third seed Karolina Pliskova struggled but advanced.
Serbian star Djokovic, who has won four of the past five Grand Slam singles titles, dispatched Spain's 76th-ranked Roberto Carballes Baena 6-4, 6-1, 6-4.
"Getting out of the blocks, it takes time for you to feel comfortable on the court," Djokovic said. "I'm quite pleased with my performance and looking forward to the next one."
Djokovic, trying to become the first back-to-back US Open winner since Federer won from 2004-2008, will next face Argentina's 56th-ranked Juan Ignacio Londero.
Djokovic owns 16 Grand Slam titles and is chasing the record 20 won by Federer with Spain's Rafael Nadal on 18. Together the "Big Three" have won the past 11 Slam titles and are again heavy favorites.
Australian second seed Barty overcame a horrible start to oust 80th-ranked Zarina Diyas of Kazakhstan 1-6, 6-3, 6-2.
Barty made 19 unforced errors to drop the first set in 28 minutes, but took nine of the last 11 games to book a date with American Lauren Davis.
"I was really pleased to be able to solve this riddle," said Barty. "Zarina was able to put me in difficult positions."
Pliskova, a 2016 US Open runner-up, edged 138th-ranked Czech compatriot Tereza Martincova 7-6 (8/6), 7-6 (7/3) after exchanging service breaks over the first six games.
"Not my best performance today for sure," Pliskova said. "Not happy that I lost three breaks of serve in a row. That's not possible for next time."
She faces Georgian qualifier Mariam Bolkvadze next.