The Nikkei share average ended 1.5 percent higher at 21,457.29 points, posting the biggest daily gain since mid-August. It had opened lower following overnight weakness on Wall Street where big technology and internet shares declined sharply.

The broader Topix rose 1.4 percent to 1,611.46 in heavy trade, with more than 4 trillion yen in turnover, the highest level since late May.

The spike in turnover was caused by passive investors' portfolio rebalancing due to the Topix index's annual free-float adjustment for companies whose business years ending March.

U.S. shares fell after Bloomberg reported that Washington is planning an additional $257 billion worth of tariffs on Chinese goods if upcoming talks between Presidents Donald Trump and Xi Jinping fail to end the trade war.

During late Asian trade, gains started building as some traders looked to strength in Chinese stocks which rebounded from Monday's declines after the securities regulator said it would enhance market liquidity.

Traders also noted that sentiment may have been supported by comments from Trump that he thinks there will be "a great deal" with China on trade.

"I think that we will make a great deal with China and it has to be great, because they've drained our country," Trump said in an interview with FOX News Channel's "The Ingraham Angle" on Monday.

"There were expectations that Trump may have something in mind to ease U.S.-China trade war tensions," said Chihiro Ohta, general manager of investment research at SMBC Nikko Securities.

Tuesday's gainers included recently-sold cyclical stocks such as machinery makers and auto shares.

"Since global investors are selling growth stocks with high valuations, it's hard to buy Japanese stocks in the same category. In this situation, cheaply-valued cyclical stocks are outperforming," said Norihiro Fujito, a chief investment strategist at Mitsubishi UFJ Morgan Stanley Securities.

He said domestic long-term investors such as pension funds are seen picking up beaten-down stocks after the value of their stock holdings dropped due to the recent sell-off.

With first-half Japanese corporate earnings in focus, construction equipment maker Komatsu Ltd surged 6.2 percent after it raised its full-year operating profit forecast thanks to strong sales of mining equipment in the U.S. and Indonesia.