On July 31, 2010, López was traded to the San Francisco Giants for Joe Martinez and John Bowker.
He appeared in 27 games for the Giants, earning a 2–0 record with an ERA of 1.42.
His combined record of 4–2 for the year with both Pittsburgh and San Francisco came in 77 appearances with an ERA of 2.34, both career records.
Left-handed batters hit only .162 against López, lowest among all National League left-handers (minimum 85 at-bats).
He ended the season five days short of qualifying for free agency.

López reached the playoffs as the Giants won the NL West for the first time since 2003.
He made two appearances in the NLDS against the Atlanta Braves to face Jason Heyward, whom he struck out both times.
The Giants won the series in four games.
Against the Philadelphia Phillies in the NLCS, he made five appearances, all scoreless except for Game 4, in which he allowed a run.
In the deciding Game 6, he pitched a scoreless seventh inning and was awarded with a win after Juan Uribe hit a game-winning home run against Ryan Madson in the eighth inning.
López made two appearances against the Texas Rangers in the 2010 World Series, striking out the two batters he faced.
In Game 2, he struck out Josh Hamilton to end the top of the eighth inning with a runner on second and preserve a 2–0 lead, although the Giants went on to win 9–0.
He won his second World Series ring as the Giants defeated the Rangers in five games to win their first World Series since 1954.
Javier had a little girl named Kylan on March 19
On July 31, 2010, López was traded to the San Francisco Giants for Joe Martinez and John Bowker. He appeared in 27 games for the Giants, earning a 2–0 record with an ERA of 1.42. His combined record of 4–2 for the year with both Pittsburgh and San Francisco came in 77 appearances with an ERA of 2.34, both career records. Left-handed batters hit only .162 against López, lowest among all National League left-handers (minimum 85 at-bats). He ended the season five days short of qualifying for free agency.
López reached the playoffs as the Giants won the NL West for the first time since 2003. He made two appearances in the NLDS against the Atlanta Braves to face Jason Heyward, whom he struck out both times. The Giants won the series in four games. Against the Philadelphia Phillies in the NLCS, he made five appearances, all scoreless except for Game 4, in which he allowed a run. In the deciding Game 6, he pitched a scoreless seventh inning and was awarded with a win after Juan Uribe hit a game-winning home run against Ryan Madson in the eighth inning. López made two appearances against the Texas Rangers in the 2010 World Series, striking out the two batters he faced. In Game 2, he struck out Josh Hamilton to end the top of the eighth inning with a runner on second and preserve a 2–0 lead, although the Giants went on to win 9–0. He won his second World Series ring as the Giants defeated the Rangers in five games to win their first World Series since 1954. Javier had a little girl named Kylan on March 19
Javier López (baseball)