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.