U.S. stocks erased losses and turned higher on Tuesday, boosted by home improvement retailer Home Depot and online retailer Amazon.com .

The Dow Jones industrial average <.DJI> gained 27.25 points, or 0.22 percent, to 12,225.13. The Standard & Poor's 500 Index <.SPX> rose 0.95 point, or 0.07 percent, to 1,311.14. The Nasdaq Composite Index <.IXIC> advanced 12.25 points, or 0.45 percent, to 2,742.93.

(Reporting by Chuck Mikolajczak; Editing by Kenneth Barry)