DEV Community

a353551071
a353551071

Posted on

I built a free dividend calculator suite (no signup, open-source math)

Every "free" dividend calculator I tried wanted an email, a signup, or a trial. The math behind all of them is public — yield, payout ratio, reinvestment compounding — so I built a dividend payout calculator that's actually free, runs entirely in the browser, and open-sources the engine.

What's in it

A suite of focused calculators rather than one mega-tool:

  • Dividend yield + payout ratio — the two-number sustainability check.
  • DRIP calculator — year-by-year reinvestment with a results table and chart.
  • Monthly dividend calculator — work backwards from the monthly income you want to the capital required.
  • Dedicated ETF calculators for SCHD (quarterly dividend growth) and QQQI (monthly income) — plus a live QQQI dividend calendar with recent distributions and the next projected ex-dividend date.

No account, no paywall, no "trial expired." It's a static site — the math is client-side.

The engine: a tiny open-source library

The interesting part was never the UI — it was the math. So I pulled every formula into one zero-dependency TypeScript library: dividend-math.

import {
  dividendYield,
  payoutRatio,
  monthlyDividendIncome,
  dripCalculator,
} from 'dividend-math';
Enter fullscreen mode Exit fullscreen mode

A few engineering choices worth calling out:

  • Pure functions everywhere. Every formula is a pure function with no I/O — dividendYield, payoutRatio, monthlyDividendIncome, dripCalculator. That makes the edge cases (zero price, zero earnings, the g = 0 branch in the cumulative-dividend geometric series) easy to pin down with 16 unit tests.
  • One source of truth. The same dripCalculator drives the DRIP page, the SCHD and QQQI ETF calculators, and the monthly-income page. One implementation, no drift between pages.
  • Plain-number inputs. Percentages are plain numbers (5 for 5%), money is dollars. Bad inputs fail loudly (NaN) instead of returning plausible-looking nonsense.
  • Static, no backend. It's a statically-generated site — all computation happens in your browser, nothing is sent anywhere. Which is also why it can be free and sign-up-free forever.

Why open-source it

Two reasons. First, the math is commodity knowledge — yield, payout, reinvestment — there's no secret sauce to hoard. Second, open-sourcing it is the credibility move for a finance tool: you can read exactly what the calculator is doing instead of trusting a black box. The library is on npm (npm install dividend-math) and the source is up: github.com/a353551071/dividend-math, MIT.

Try it

Engineering / showdev post, not financial advice. The calculators model scenarios; they don't recommend securities.

If you've got feedback — a calculator that's missing, a model you'd extend (tax drag? FX? yield-on-cost columns?) — I'd genuinely like to hear it. Building in public.

Top comments (0)