It will be Ban's first visit to Japan since he took over as secretary general last year, although he visited Tokyo shortly before his investiture in his previous job as South Korea's foreign minister.
On the June 28-July 1 visit, Ban will hold talks with Prime Minister Yasuo Fukuda and will be received by Emperor Akihito.
Japan "sincerely welcomes the first visit" by the UN chief "which will further strengthen the cooperative relationship between Japan and the United Nations," a foreign ministry official said.
He will take part in a public meeting on global warming at Kyoto University in western Japan.
More From This Section
Kyoto is a birthplace of the landmark 1997 Kyoto Protocol on curbing greenhouse gas emissions. Negotiations have been moving slowly on drafting a framework for after Kyoto's obligations run out in 2012.
The UN chief's visit comes just ahead of the July 7-9 summit of the Group of Eight industrialised nations in the northern resort of Toyako.
The G8 is made up of Britain, Canada, France, Germany, Italy, Japan, Russia and the United States.
Japan has also invited other countries - Australia, Brazil, China, India, Indonesia, Mexico, South Korea and South Africa - to a parallel summit on climate change due on July 9.