Sharapova of Russia 6-1, 6-3
in the quarterfinals. In her prior two tournaments, the
second seeded Russian had reached the semifinals at the French Open and the final at Wimbledon.
With Bartoli attacking from the baseline, Williams fell behind early in the final 2-4 before evening the first set at 4 all.
At 4-5in the first set, Williams would win eight games in a row to reach 5-0 in the second set behind strong overhead, serve and backhand winners.
The 29 year old American would strike a final forehand crosscourt winner to set up match point.
The Stanford tournament is part of the US Open Series group of American hard court tournaments which precede the US Open which begins August 29th at New York.
A three-time US Open winner, Williams took the New York title in 1999, 2002 and 2008.
Williams is next set to compete next week at the Rogers Cup at Toronto, Canada alongside her sister Venus Williams.