When people hear "calculator website," they picture one page with a few inputs. Mine has over two thousand calculator pages — income tax, loan installments, BMI, unit conversions — all running on pure client-side JavaScript. No backend, no database, no tracking, no signup.
Building it taught me a few things that generalize well beyond calculators.
- A calculator is a formula plus trust
Nobody bookmarks a calculator because of its design. They come back because the number was right. That makes correctness the actual product.
Every formula on the site is validated against an official source before it ships. For example, the income-tax calculator follows Indonesia's PPh 21 progressive brackets exactly (5% / 15% / 25% / 30% / 35% on annual taxable income), including the standard deductions. If a tax rule changes, the formula changes — the page is just a view over it.
Lesson: when your app outputs a number someone will act on, write the formula once, test it against known worked examples, and treat formula changes like database migrations.
- Floating point will embarrass you
0.1 + 0.2 = 0.30000000000000004 is a meme until it shows up in someone's loan installment.
The rule I follow everywhere: do all money math in the smallest integer unit, and format only at the very end.
// Fragile: float division on money
const monthly = annualTax / 12; // 250000.00000000003
// Robust: integer rupiah, format at display time
const monthly = Math.round(annualTax / 12);
new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR',
maximumFractionDigits: 0,
}).format(monthly); // "Rp 250.000"
Intl.NumberFormat also handles locale-specific grouping for free — id-ID gives you dots as thousand separators, which is what Indonesian users expect.
- Programmatic SEO without a backend
Two thousand pages sounds like a CMS problem, but each calculator is really the same template: one URL, one H1, one formula, a worked example, and FAQ schema. Generate the pages at build time, serve them as static HTML.
Static pages give you three things for free: instant load times (the whole point of a quick calculator), trivially cheap hosting, and crawlability without any SSR plumbing. The site's PPh 21 calculator page, for instance, is just a static page wrapping one well-tested function.
- No signup means no excuses — and no auth code
Skipping accounts was a deliberate tradeoff. No auth means no password resets, no session bugs, no user data to leak. The cost: you can't sync history across devices. localStorage covers "recently used calculators" well enough that nobody misses accounts.
If your product's core value doesn't require identity, consider not having identity. It's the cheapest security posture there is.
- Edge cases are the product
Real users type 10jt, paste numbers with commas, enter negatives, and leave fields empty. Every input goes through the same pipeline: strip formatting characters → parse → clamp to a sane range → show a helpful error instead of NaN.
Boring? Completely. But the difference between a calculator people trust and one they bounce from is almost entirely in how it handles bad input.
The end result of all this is live at kalkulatorin.id — a free Indonesian toolkit of 2000+ calculators and unit converters. The PPh 21 calculator there runs the exact formula pipeline described above. Everything is client-side; your numbers never leave your browser.
Top comments (0)