Williams, 41, has won seven major titles, including victories at Flushing Meadows in 2000 and 2001. But with her current WTA ranking of No. 112, she has fallen outside the top 104 who received direct entry into the women's main draw.
Williams hasn't missed the U.S. Open since 2006 when she was sidelined by a left wrist injury. She reached her last major semifinal there in 2017.
CoCo Vandeweghe, who also reached those semifinals, also was awarded a wild card by the U.S. Tennis Association. The former No. 9-ranked American has battled injuries and is currently No. 160.
American teenagers Caty McNally, Hailey Baptiste, and Katie Volynets also received women's wild cards, along with 20-year-old Emma Navarro, the NCAA champion at Virginia, and Ashlyn Krueger. Krueger, 17, won the USTA Girls' 18s national championship to earn a wild-card spot.
On the men's side, 20-year-old Americans Jenson Brooksby and Brandon Nakashima were rewarded for their strong summers with wild cards. Both are now ranked inside the top 100, which would have been good enough for direct entry when the July 19 ATP rankings were used.
Jack Sock, who was once ranked eighth but has since struggled with injuries, received a wild card along with fellow Americans Emilio Nava and Ernesto Escobedo.
NCAA singles champion Sam Riffice of Georgia and USTA Boys' 18s champion Zachary Svajda also got spots into the tournament that starts Aug. 30, along with Australians Max Purcell and Storm Sanders.