The 28-year-old Russian has not played since Wimbledon following a knee injury and posted on Facebook: "I have done everything possible to be ready but it was just not enough time."
The five-time Grand Slam winner was due to play Australian world number 37 Daria Gavrilova on Monday in New York.
In her statement, Sharapova said she is targeting a return in "a few weeks".
The 2006 champion, who has not lost in the first round of a Grand Slam since 2010, had travelled to Flushing Meadows and spoke to the media on Saturday.
However, she announced her withdrawal 24 hours later via social media.
Fellow Russian Daria Kasatkina takes Sharapova's place in the draw as a qualifying lucky loser.
World number three Maria Sharapova has pulled out of the US Open on the eve of the tournament because of injury.