U.S. stock indexes reversed earlier losses to turn positive on Tuesday after data showed consumer confidence rose modestly in August, helped by an improvement in the short-term outlook.

* The Dow Jones industrial average <.DJI> gained 18.46 points, or 0.18 percent, to 10,028.19. The Standard & Poor's 500 Index <.SPX> added 1.15 points, or 0.11 percent, to 1,050.07. The Nasdaq Composite Index <.IXIC> edged up 1.04 points, or 0.05 percent, at 2,121.01.

(Reporting by Leah Schnurr; editing by Jeffrey Benkoe)