Stocks traded higher on Tuesday, erasing earlier losses, led by a rise in bank and tech shares.

The Dow Jones industrial average traded 100 points higher after falling as much as 180.24 points. Goldman Sachs and Caterpillar were the biggest contributor of gains to the 30-stock index, both rising more than 1 percent.

The S&P 500 rose 0.4 percent, with financials as the best-performing sector. Wells Fargo was the best-performing stock in the financials sector, rising 2.4 percent. Tech, meanwhile, rose 0.4 percent after trading lower earlier in the session.

The Nasdaq composite climbed 0.6 percent, with shares of Nvidia, Amazon and Alphabet all trading higher. The tech-heavy index fell as much as 0.6 percent earlier in the session.

"The market was trading with some reservation to the downside," said Robert Pavlik, chief investment strategist at SlateStone Wealth, noting the indexes quickly bounced off their session lows. "There wasn't much follow-through down."

Earlier in the session, the major averages fell as investors continued to digest the recent wild market swings on Wall Street.

"This all goes back to the fact that we were overbought on Jan. 26, when we hit all-time highs, and then the next week we got one data point that spooked the market: wage growth," said Marc Chaikin, CEO of Chaikin Analytics. "The market is spooked by inflation."

A sharp rise in interest rates over the past few weeks has sent jitters through Wall Street, as inflation fears raised worry that the Federal Reserve will have to tighten monetary policy faster than the market expects. These worries are reflected in a Bank of America Merrill Lynch survey, which showed professional investors slashed their bond allocations to their lowest levels in 20 years.

The benchmark 10-year yield hit a four-year high on Monday. It traded slightly lower at 2.844 percent Tuesday as investors looked ahead to the release of key inflation data.

The latest reading on the Consumer Price Index is scheduled for release Wednesday at 8:30 a.m. ET.

"Tomorrow will bring the most important CPI report in over 10 years, as rising inflation (which will cause higher interest rates) has become one of the biggest risks to this multi-year rally," Tom Essaye, founder of The Sevens Report, said in a note Tuesday.

Stock-market volatility has roared back recently amid increasing inflation fears and the rise in interest rates. The S&P 500 has posted moves greater than 1 percent in six of the past eight trading days. For context, the broad index posted just eight 1 percent moves all of last year. Read more at CNBC