Resource-scarce Japan imports almost all its oil, and prices for crude oil and other commodities surged last year, partly due to the war in Ukraine.
The value of the Japanese yen fell against the U.S. dollar and other currencies, meanwhile, as central banks raised interest rates to fight inflation.
The U.S. dollar was trading at about 128 yen Thursday, but it has shot up to as high as 150 yen in recent months.
By region, Japan marked a trade surplus with the U.S. but racked up a deficit with China and Europe.
For decades, Japan was criticized by the U.S. and other nations for its exporting prowess, exemplified in the auto industry, which some saw as a threat to American workers. Since then, Japan has shifted much of its manufacturing production overseas.