Skip to main content

2026-11-30 · 7 min read

Three tools for Japan trips: the new tax-refund rules, voltage math, and a yen cheat-sheet wallpaper

DataCSS

Translated from the Chinese original: read it in Chinese

After the site's small tools reached 21, I asked myself "what other tools could I build?". I listed nine and built three of them at once, all things a Taiwanese traveler to Japan would use:

  • Japan tax refund calculator: how much you bought, how much you can get back, and by when you have to apply
  • Appliance compatibility check for trips abroad: can your hair dryer or laptop be used in Japan
  • Yen cheat card: today's exchange rate as a phone wallpaper

(All three tool pages are in Chinese.) Three things from the process are worth writing down.

1. Refund rules: check the tax agency, don't rely on explainer articles

From November 1, 2026, Japan's tax-free shopping changed to a "refund method": you pay the price including tax at the shop, and when you leave the country, customs confirm that the goods really left with you, and then the consumption tax is refunded. This was right after the system changed, and there are plenty of explainer articles online, but I was writing a tool that "computes numbers for people to look at", and wrong numbers mislead.

My first search returned only private companies' explainer pages. So I searched again, limited to official domains such as the National Tax Agency (Kokuzeicho), Customs and the Ministry of Finance, and found the National Tax Agency's Q&A (the July Reiwa 8 edition). The rules I confirmed from official material:

RuleContent
ThresholdThe sales to the same traveler, at the same shop, on the same day, totalling at least 5,000 yen excluding tax
DeadlineWithin 90 days counting from the day after purchase, confirmed by customs at the airport or port you leave from (example: bought 11/1 → 1/30 of the next year)
One item missingIf even one item in the same purchase record is not with you, the whole record cannot be confirmed
Shipped separatelyGoods sent separately after purchase (shipped home) have no customs confirmation data and get no refund

There is one rule I could not confirm item by item in official material: that the old system's "general goods / consumables" categories and the 500,000 yen cap on consumables are gone. This only appeared in private explainers, and the Ministry of Finance's tax reform material was the old system's table. So the code only judges on "threshold" and "deadline", the two rules with official sources; the other one is only written in the page's explanation, marked "from private explainers, not confirmed item by item".

The deadline has one easy-to-miscalculate point: "90 days counting from the next day" equals "purchase date + 90 days". November 1 plus 90 days is exactly January 30 of the next year, and a unit test pins that example.

export function refundDeadline(purchaseDate: string): string | null {
  const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(purchaseDate);
  if (!m) return null;
  const t = Date.UTC(+m[1], +m[2] - 1, +m[3]);
  const d = new Date(t);
  if (Number.isNaN(t) || d.getUTCMonth() !== +m[2] - 1) return null; // reject dates like 2026-02-30
  return new Date(t + 90 * 86400000).toISOString().slice(0, 10);
}

Date.UTC(2026, 1, 30) does not throw; it silently becomes March 2, so you have to compare whether the month got "carried over".

2. A test I got wrong: back-calculating the pre-tax price, and rounding moves the threshold by 1 yen

The threshold is about the amount excluding tax, but a receipt usually shows the total including tax, so it has to be back-calculated: pre-tax = tax-inclusive ÷ (1 + tax rate), with fractions always rounded up (the same algorithm as the site's existing "Japan consumption tax" tool).

When writing the test I assumed that for 8% food, 5,399 including tax is not enough and 5,400 is enough. Running it, the 5,399 case failed:

5,399 ÷ 1.08 = 4,999.07 → rounded up → 5,000 → meets the threshold
5,398 ÷ 1.08 = 4,998.15 → rounded up → 4,999 → 1 yen short

The tool was not wrong; my expectation was. Rounding up makes an amount "right on the threshold" differ from intuition by 1 yen, and how a shop actually handles fractions may differ too. So the page says: when you are right at the threshold, the receipt is authoritative. The test now pins the two values "5,399 meets it, 5,398 is 1 yen short", with a comment saying why.

3. Appliance compatibility: heating power scales with voltage squared

Taiwan is 110V and Japan is 100V. Many people think "it's only 10V". But heating appliances (hair dryers, rice cookers, curling irons) are essentially resistors, with power P = V² ÷ R, proportional to the square of the voltage:

A 110V appliance plugged into Japan's 100V: (100 ÷ 110)² = 0.826 → about 83% of the power
A Japanese 100V appliance brought to Taiwan's 110V: (110 ÷ 100)² = 1.21 → about 121% of the power

So "a 110V appliance in Japan" works but heats less and takes longer to cook; "a Japanese appliance back in Taiwan" heats more, and heating appliances need care. The tool's judgment is a rule of thumb:

  • Voltage difference within ±5%: normal
  • ±5% to 10%: usable, but it computes how much the heating power changes
  • Over 10%: do not plug in directly (too high burns it out, too low mostly means it will not work)

Frequency is judged separately, because Japan's east and west halves use different frequencies (50 Hz in eastern Japan, 60 Hz in western Japan). Electronic chargers usually do not care, while anything with a motor, a clock or a transformer is affected. So "eastern Japan" and "western Japan" are two separate destinations in the tool.

All of this is nominal values plus rules of thumb, not a safety certification, and the page says so: for high-wattage heating appliances, read the manual or ask the manufacturer before travelling. This tool has no measured data; the unit tests only verify that "the formulas are computed right" (for example 83% and 121%), not any real appliance.

4. Saving a card as wallpaper: an SVG must carry its own colors

The yen cheat card is a 540×960 SVG, drawn in the browser as a 1080×1920 PNG for download. It reuses the site's radar card CardDownload (SVG → <img> → canvas → blob).

This approach has one limitation to know in advance: when an SVG is loaded as an image, it cannot see the page's CSS variables or web fonts. So the colors in the card are hard-coded to the light set (#fafaf8, #1a1a1a, #2d5a8e), and the font is the system's built-in Chinese font. In dark mode the preview card is still a light card, on purpose: it is "a card" to be saved, not part of the page.

For verification I ran the conversion on the page for real: drew the card with the live exchange rate, and the exported PNG is 245 KB.

5. Mobile: long dropdown text stretched the whole page

The appliance check page has four dropdowns with very long option text (for example "Japan (eastern Japan: Tokyo, Yokohama, Sendai, Hokkaido …)"). It is fine on a desktop, but measured on a 375px-wide phone, the whole page's scrollWidth was 406px, 31px wider than the screen, with horizontal scrolling.

The cause is that a <select>'s minimum width follows its longest option by default, and inside a grid it stretches the column. The fix is min-w-0 on the wrapper and w-full min-w-0 on the dropdown, after which it measures 375px.

This problem cannot be seen by looking at the desktop layout; it was found by measuring at phone size.

What was verified and what was not

  • All 549 unit tests in the project pass, including new ones covering refund threshold and deadline, voltage / frequency / plug judgments, and exchange rate conversion.
  • 34 E2E tests pass, including 7 new ones (refund, appliances, cheat card), the a11y scan, the sitemap and the privacy check.
  • The official basis for the refund rules: the National Tax Agency Q&A; threshold, deadline, shipped separately and one-item-missing have official sources, the old-system cap does not.
  • Not verified: the appliance judgment has not been tested on any real appliance; for the refund I only compute the consumption tax itself, and fees that shops or refund agents may charge are not included; the system may be adjusted again later.

Summary

  • For a tool that "computes numbers for people to look at", look up the rules at the official source, and honestly mark "not confirmed" on the page for what you cannot find.
  • Rounding rules make boundary values differ from intuition by 1; tests should pin the boundary and write the reason in a comment.
  • For heating appliances, look at the square of the voltage, not how many volts apart.
  • If an SVG is to be saved as an image, it must carry its own colors and fonts and cannot rely on the page's CSS.
  • A <select> with long options needs min-w-0 on a phone, and you must really measure it at phone width.

Related commits: 7ccbc1a (GitHub)

Author

PINGWEI LI

Student developer from Kaohsiung, Taiwan, building AI tools and web apps.

About meAll notes

Related

Type to search projects and posts too