TOKYO, July 3 (Reuters) - Japan's Nikkei share average rose on Wednesday as heavyweight technology stocks tracked U.S. megacap growth stocks higher overnight. The Nikkei was up 0.81% at 40,398.35 as of 0142 GMT, after opening 0.38% higher.

Wall Street stock indexes closed higher on Tuesday, boosted by gains in Tesla and megacap growth stocks, but volumes were thin ahead of the July 4 holiday and the closely watched release of June nonfarm payrolls on Friday.

The broader Topix inched up 0.13% to 2,860.26, and is set to log a fourth straight session of gains.

"Investors rotated their targets today. They sold outperforming shares to take profits and bought cheaper stocks," said Naoki Fujiwara, senior fund manager at Shinkin Asset Management.

"The Nikkei tracked Wall Street, higher but also those who were late in catching up the recent rally bought Nikkei futures, which lifted the main index," said Fujiwara.

Topix's growth stock index, which lags behind the value share index for its weekly performance, rose 0.46%, while the value share index slipped 0.34%.

Chip-making equipment maker Tokyo Electron rose 2.48% to provide the biggest boost to the Nikkei. Chip-testing equipment maker Advantest gained 1.64%.

Electronic components maker TDK jumped 3.99% and silicon wafer maker Shin-Etsu Chemical climbed 2.4%.

Conglomerate Hitachi slipped 2.08% to weigh on the Topix the most. Toyota Motor fell 0.9%.

Insurer Tokio Marine Holdings dropped 1.56% and banking group Mitsubishi UFJ Financial Group slipped 0.5%.

Of the more than 1,600 stocks trading on the Tokyo Stock Exchange's prime market, 50% of the shares rose, while 45% fell and 3% were unchanged. (Reporting by Junko Fujita; Editing by Sonia Cheema)