The benchmark Nikkei 225 index added 0.96 percent, or 195.04 points, to 20,456.08 yen, while the broader Topix index gained 0.79 percent, or 11.66 points, to 1,489.69.
The Nikkei stayed comfortably in positive territory throughout the day after Trump on Monday said the United States and China will resume their trade talks "very shortly", boosting Wall Street shares.
The comments came just as the world's two biggest economies exchanged biting tariffs.
Trump's comment, and the reaction of US markets, encouraged Tokyo players, who had already positioned themselves to buy bargains after the Nikkei plunged more than two percent on Monday on jitters over US-China trade relations.
"President Trump announced the resumption of US-China trade talks, sending US markets rising overnight. It encouraged buying (in Tokyo) and lifted the Nikkei," Okasan Online Securities said in a commentary.
"Coupled with a technical rebound after the sharp losses seen on the previous day, the market moved at a high range."
A solid rise on the Shanghai market also encouraged investors in Tokyo.
But a lack of other fresh incentives capped further gains, the brokerage said.
Slipping US yields were also pressuring the dollar, which stood at 105.70 yen in Tokyo, compared with 106.08 yen in New York but a tad higher than 105.24 yen in Tokyo on Monday.
Among major shares, SoftBank Group rose 2.42 percent to 4,647 yen. Sony added 0.74 percent to 5,882 yen, and Uniqlo operator Fast Retailing jumped 1.80 percent to 62,330 yen.
Construction equipment maker Komatsu eased 0.16 percent to 2,222 yen, while industrial robot producer Fanuc added 0.39 percent to 17,860 yen.