Loading workbench page
Fetching primary parquet sources and computing exhibits.
Fetching primary parquet sources and computing exhibits.
Japan Customs has published a "Country by Commodity" trade return every year since 1988, each release a December cumulative of that calendar year's exports and imports by trading partner and nine-digit statistical code. Seven figures below trace the resulting 38-year record: the overall trend in exports and imports, the rise and partial retreat of China as Japan's largest trading partner, who Japan trades with today, what it sells, and where the bilateral surpluses and deficits sit. All values are in Japanese yen; Japan Customs does not publish a matching monthly exchange-rate series in this dataset, so nothing here is converted to US dollars.
Japan's exports grew from ¥33.94T in 1988 to a record ¥110.40T in 2025 (a 3.25× increase), but the path was not a straight line. Exports peaked ahead of the 2008 global financial crisis, collapsed by more than a third into 2009, and did not durably clear the pre-crisis peak until the yen's post-2022 depreciation and elevated global demand pushed exports to consecutive records in 2024 and 2025. The trade balance tells a separate story: Japan ran a goods surplus every year from 1988 through 2010, then swung to deficit in 2011, coinciding with the post-Fukushima shutdown of nuclear generation and the resulting surge in fossil-fuel imports. The deficit widened sharply to -¥20.33T in 2022, when the weak yen inflated the yen cost of imported energy, and has narrowed in every year since, reaching -¥2.93T in 2025.
SELECT year, flow, SUM(value_kjpy) AS v
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet')
GROUP BY year, flow
ORDER BY year, flow;China overtook the United States as the largest single source of Japan's imports in 2002 and has never given up the lead since: by 2025, China supplied 23.6%of Japan's imports against 11.4%from the United States. The export side is a much tighter contest. China first passed the United States as Japan's top export market in 2009, as the global financial crisis hit US demand harder than Chinese demand, but the two have traded the lead repeatedly since (the United States regained it in 2013, China in 2018, the United States in 2019, China again in 2020, and the United States in 2023). As of 2025, the United States is narrowly back in front, at 18.5% of Japan's exports versus 17.0% for China.
The United States and China together took 35.5% of Japan's 2025 exports, more than the next eight destinations combined. On the import side China alone supplied nearly a quarter of the total, and the next tier down is dominated by energy and raw-material suppliers (Australia, the UAE, Saudi Arabia) alongside the East Asian electronics supply chain (Taiwan, Korea, Vietnam, Thailand).
In 2000, electrical machinery and electronics (HS chapter 85, which includes semiconductors and consumer electronics) was Japan's largest export category, ahead of general machinery (84) and vehicles (87). By 2025, vehicles had taken the top spot after growing 2.32× since 2000, while electrical machinery grew only 1.23× and slipped to third. The sharpest relative move is chapter 71 (pearls, precious stones and precious metals): exports there grew 21.8× from 2000 to 2025, and 82.9% of that 2025chapter-71 total is a single heading, gold (HS 7108), consistent with the broader run-up in gold prices and investment demand over the period rather than a shift in Japanese manufacturing. Chapter 00, Japan Customs' own non-standard code, has also grown steadily in relative terms, from 3.5% of exports in 2000 to 9.3% in 2025; its underlying commodity content could not be confirmed against Japan Customs' public glossary (see note below the chart), but its magnitude is real and independently verified against the partner-total series in Figure 1.
At four-digit resolution, passenger cars (HS 8703) are Japan's single largest export line by a wide margin, ¥15.76T in 2025. The second line by value is the unclassified "0000" code discussed above, not a product. Beyond those two, the list is dominated by the semiconductor supply chain (integrated circuits, HS 8542; semiconductor and flat-panel manufacturing equipment, HS 8486; discrete semiconductor devices, HS 8541) and the vehicle supply chain (motor vehicle parts, HS 8708; goods vehicles, HS 8704), with gold (HS 7108) and construction/earth-moving machinery (HS 8429) rounding out the top tier.
Japan's largest bilateral surplus in 2025 is with United States of America at ¥7.46T, and its largest deficit is with People's Republic of China at -¥7.92T, the mirror image of China's position as Japan's top single import source. Hong Kong is a striking outlier: Japan sold it ¥6.41T in exports against just ¥0.28T in imports, a surplus of ¥6.13T, consistent with Hong Kong's role as a re-export and entrepôt hub rather than a final consumer of Japanese goods. The rest of the deficit side, Australia, Saudi Arabia, and the UAE, is the energy and raw-material bill: none of the three is a significant destination for Japanese exports, but all three are major suppliers of coal, LNG, iron ore, or crude oil.
Japan's export engine more than tripled in yen terms over 37 years but did not grow smoothly: a financial-crisis collapse, a decade-long deficit driven by post-Fukushima energy imports and a weak yen, and a return to record exports and a narrowing (though not yet closed) deficit by 2025. China displaced the United States as Japan's dominant supplier of imports two decades ago and has not looked back, but as an export market the two countries remain locked in a genuinely close contest that has changed hands six times since 2009. Underneath both trends, the product mix has shifted from an electronics-led export base in 2000 toward one led by vehicles, with a fast-growing (if largely gold-driven) precious-metals category alongside it, and the bilateral balance sheet reads exactly as the commodity mix would predict: surpluses with assembly and re-export partners (the United States, Taiwan, Korea, Hong Kong), deficits with the energy and raw-material suppliers (China, Australia, Saudi Arabia, the UAE) that keep Japan's factories running.
Method notes.All figures use Japan Customs' own 9-digit statistical classification (japan_annual_hs2, japan_annual_hs4, japan_annual_partner_totals), whose first six digits align with the international HS code and whose first two digits equal the HS chapter number, per Japan Customs' published glossary. Values are value_kjpy, thousand Japanese yen; 1 trillion yen equals 1e9 in that unit. Country codes are Japan Customs' own three-digit numeric codes, mapped to ISO3 via the official code list at customs.go.jp; 701/702/703 ('Special Area', not real countries) are excluded from every partner-level figure. The japan_annual_hs2 total for any year/flow matches the independently-computed japan_annual_partner_totals total exactly, confirmed for 2025 exports during data validation.
WITH tot AS (
SELECT year, flow, SUM(value_kjpy) AS total
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet')
GROUP BY year, flow
),
p AS (
SELECT year, flow, partner_iso3, SUM(value_kjpy) AS v
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet')
WHERE partner_iso3 IN ('CHN','USA')
GROUP BY year, flow, partner_iso3
)
SELECT p.year, p.flow, p.partner_iso3, 100.0 * p.v / tot.total AS share
FROM p JOIN tot USING (year, flow)
ORDER BY p.year, p.flow, p.partner_iso3;WITH latest AS (SELECT MAX(year) AS y FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet'))
SELECT partner_iso3, partner_name, SUM(value_kjpy) AS v, latest.y AS year
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet'), latest
WHERE flow = 'X' AND year = latest.y AND partner_iso3 IS NOT NULL
GROUP BY partner_iso3, partner_name, latest.y
ORDER BY v DESC
LIMIT 10;WITH latest AS (SELECT MAX(year) AS y FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet'))
SELECT partner_iso3, partner_name, SUM(value_kjpy) AS v, latest.y AS year
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet'), latest
WHERE flow = 'M' AND year = latest.y AND partner_iso3 IS NOT NULL
GROUP BY partner_iso3, partner_name, latest.y
ORDER BY v DESC
LIMIT 10;WITH latest AS (SELECT MAX(year) AS y FROM read_parquet('data/parquet/japan_annual_hs2.parquet')),
top8 AS (
SELECT hs2
FROM read_parquet('data/parquet/japan_annual_hs2.parquet'), latest
WHERE flow = 'X' AND year = latest.y
GROUP BY hs2
ORDER BY SUM(value_kjpy) DESC
LIMIT 8
)
SELECT hs2, year, SUM(value_kjpy) AS v
FROM read_parquet('data/parquet/japan_annual_hs2.parquet'), latest
WHERE flow = 'X' AND hs2 IN (SELECT hs2 FROM top8) AND year IN (2000, latest.y)
GROUP BY hs2, year
ORDER BY hs2, year;WITH latest AS (SELECT MAX(year) AS y FROM read_parquet('data/parquet/japan_annual_hs4.parquet'))
SELECT hs4, SUM(value_kjpy) AS v, latest.y AS year
FROM read_parquet('data/parquet/japan_annual_hs4.parquet'), latest
WHERE flow = 'X' AND year = latest.y
GROUP BY hs4, latest.y
ORDER BY v DESC
LIMIT 15;WITH latest AS (SELECT MAX(year) AS y FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet')),
x AS (
SELECT partner_iso3, partner_name, SUM(value_kjpy) v
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet'), latest
WHERE flow = 'X' AND year = latest.y AND partner_iso3 IS NOT NULL
GROUP BY partner_iso3, partner_name, latest.y
),
m AS (
SELECT partner_iso3, SUM(value_kjpy) v
FROM read_parquet('data/parquet/japan_annual_partner_totals.parquet'), latest
WHERE flow = 'M' AND year = latest.y AND partner_iso3 IS NOT NULL
GROUP BY partner_iso3, latest.y
)
SELECT x.partner_iso3, x.partner_name, x.v AS exports, COALESCE(m.v, 0) AS imports,
x.v - COALESCE(m.v, 0) AS balance
FROM x LEFT JOIN m USING (partner_iso3)
ORDER BY ABS(balance) DESC
LIMIT 12;