The Standard & Poor's 500 index rose 7.16 points, or 0.4 percent, to 1,704.76. The S&P 500 was five points below its record high reached on Aug. 2. It has risen for three trading days in a row, and 10 of the last 11.
The Nasdaq composite was up 27.85 points, or 0.8 percent, at 3,745.70; it had the biggest percentage gain of the three big indexes.
Nine out of 10 industry groups in the S&P 500 rose, led by technology. The only declines were for materials stocks, which include miners, industrial gas producers and metal refiners.
Rising tech stocks included the video game company Electronic Arts, which is getting a solid start with this year's version of its Madden football franchise. Electronic Arts rose 64 cents, or 2 percent, to $27.60.
Computer memory maker Micron Technology rose 40 cents, or 2 percent, to $16.84 as investors bet that memory prices will rise after a fire shut down a competitor's factory in China.
By some measures, stock market values are as high as they were at the end of the Internet bubble in 2000, when compared to the size of the nation's economy, said Martin Leclerc, a principal and chief investment officer at Barrack Yard Advisors in Bryn Mawr, Pa.
Then, there was at least the justification of new technology.
"Now, the only justification we have is cheap money," Leclerc said.
Nonetheless, Leclerc said, with a bull market underway stocks could keep climbing regardless of valuations. "This thing is a powerful beast," he said. The current bull market is four-and-a-half years old.
The Labor Department reported on Tuesday that U.S consumer prices barely rose last month, another sign that slow economic growth is keeping inflation low. That pushed the yield on the benchmark 10-year Treasury note down slightly, to 2.85 percent from 2.86 percent late Monday.
Rising profits "support stock prices where they are, and could support, going into 2014, prices going a little higher," said Jim Dunigan, managing executive of investments for PNC Wealth Management in Philadelphia.
"Most, if not all, the evidence would suggest the economy is improving," he said.
A few companies benefited from large investments.
Safeway, a major grocery store chain, jumped $2.95, or more than 10 percent, to $30.99 after saying an unnamed investor had bought a significant amount of its stock. Safeway said it adopted a "poison-pill" defense measure to thwart any hostile takeover attempt.
Aeropostale jumped $1.56, or 18 percent, to $10.17 after Sycamore Partners disclosed an 8 percent stake in the teen retailer. And Huntsman, a chemical maker, rose 36 cents, or 2 percent, to $19.50 after saying it will pay $1.1 billion for two businesses from Rockwood Holdings, which rose 60 cents, or 2 percent, to $67.21.
Other companies making big moves included:
• Abercrombie & Fitch rode Aeropostale's coattails, moving up $1.09, or 3 percent, to $38.43.
• Microsoft rose after announcing a 22 percent dividend increase and a $40 billion stock buyback program. Microsoft gained 13 cents, or 0.4 percent, to $32.93, after going as high as $33.47 in the morning.
• Boeing rose $1.44, or 1.2 percent, to $117.11 as a stretched version of its new 787 flew for the first time. Boeing's gain was responsible for one-third of the Dow's rise.
• Outerwall, which owns the Redbox DVD kiosks, plunged $6.48, or almost 12 percent, to $49.49 after slashing its outlook because of weaker-than-expected demand for discs.
The price of crude oil fell $1.17, or 1.1 percent, to close at $105.42 a barrel in New York.