When building a consumer utility calculator for Japan, a common shortcut is multiplying wattage by the national guideline rate (31 JPY/kWh). In practice, actual household electricity bills vary by up to 1.8x depending on the regional utility, consumption tier, and contract structure.
While building 電気代シミュレーターJP (denkidaikeisan.com), I wanted to model all 10 major Japanese electric power companies in a 100% client-side, zero-backend Astro web app. Here is how the tariff math and architecture work.
Two Incompatible Tariff Models Across 10 Utilities
Japan's 10 regional utilities fall into two distinct residential tariff structures:
- 従量電灯B (Ampere-based, 6 utilities): Hokkaido, Tohoku, Tokyo (TEPCO), Hokuriku, Chubu, and Kyushu. The fixed base fee scales with the contracted breaker capacity (e.g., 30A, 40A, 50A), and every kWh is billed across three progressive tiers (typically 0–120 kWh, 120–300 kWh, and 300+ kWh).
- 従量電灯A (Minimum-charge, 4 utilities): Kansai, Chugoku, Shikoku, and Okinawa. Instead of an ampere-based base fee, a flat minimum charge covers the first 10–15 kWh, followed by three progressive kWh tiers.
On top of the base and energy charges, the Renewable Energy Power Promotion Surcharge (4.18 JPY/kWh for FY2026) is applied uniformly across all kWh consumed, regardless of region or plan.
Piecewise Calculation in Pure TypeScript
To avoid floating-point drift and keep the calculation deterministic, each utility is represented as a typed tariff config with:
-
model:'ampere' | 'minimum' -
tiers: ordered[upperBoundKwh, unitPriceJpy]tuples -
surchargePerKwh:4.18
For a single appliance running at watts for hoursPerDay, the effective marginal cost depends on which tier the household is already in:
export function calcApplianceCost( watts: number, hoursPerDay: number, effectiveUnitPriceJpy: number ) { const kwhPerHour = watts / 1000; const hourly = kwhPerHour * effectiveUnitPriceJpy; const daily = hourly * hoursPerDay; const monthly = daily * 30; return { hourly, daily, monthly }; } In the side-by-side 2-appliance comparison ("PK mode"), users can adjust wattage, daily hours, and region simultaneously to see both the operational cost difference and the payback period when upgrading an older appliance.
Why Zero-Backend Static Architecture
Because tariff tables are small, static JSON/TS structures (~15 KB gzipped for all 10 utilities and common appliance presets), shipping everything as static HTML + lightweight vanilla/island JS means:
- Instant recalculation on every slider/input event with zero API latency
- Complete privacy (no household usage data ever leaves the browser)
- Trivial CDN caching and zero server maintenance
You can try the live calculator and 10-utility breakdown at denkidaikeisan.com.