The Dow Jones rose 150.52 points or 0.73% to 20,701.50, while the wider S&P 500 index added 17 points, also a gain of 0.73%, to 2,358.57.
The tech-heavy Nasdaq index climbed 35 points, or 0.60% to 5,875.14.
Financial and energy shares did particularly well.
Other newly released data showed the trade deficit in goods narrowed sharply in February and there were more increases in house prices in January.
These figures "underscore what has been going on really in this whole rally, and that is that confidence is pretty high and optimism is high and that has kind of been underpinning the resiliency of the equity markets," said Jim Davis, regional investment manager at US Bank Wealth Management.
Earlier in the day, investors had been hoping for hints about the timing of the next rise in US interest rates from Federal Reserve head Janet Yellen, who was speaking at a conference in Washington. In the event she made no mention of monetary policy.
Among individual stocks, electric carmaker Tesla rose 2.7% after Chinese tech giant Tencent spent $1.8bn buying a 5% stake in the company.
General Motors rose 2.4% after activist investor David Einhorn's Greenlight Capital called on the car giant to split its stock into two classes. He is also calling for four new directors to be appointed by GM. The company has rejected his proposals.
Shares in Amazon added 1.1% after the company said it had agreed to buy Middle East online retailer Souq.com.
(Close): The three main US stock indexes ended the day markedly higher on Tuesday as new figures showed consumer confidence hitting its highest level for more than 16 years in March.