npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@finanzfluss/calculators

v1.2.5

Published

Financial calculators for Finanzfluss

Readme

@finanzfluss/calculators

A selection of financial calculators used on the Finanzfluss Website: https://www.finanzfluss.de/rechner/

🎯 Type-safe: built with TypeScript and Zod validation

🔍 Real-world tested: used by millions of Finanzfluss users

🏛️ German tax system support: Correct tax and insurance calculation

Installation

# pnpm
pnpm add -D @finanzfluss/calculators

# npm
npm install -D @finanzfluss/calculators

# yarn
yarn add -D @finanzfluss/calculators

Calculators

Compound Interest Calculator

The Zinseszinsrechner (https://finanzfluss.de/rechner/zinseszinsrechner) demonstrates the power of compound interest for long-term wealth building. It calculates how investments grow over time when returns are reinvested, helping users visualize the compound effect on their savings.

Key Features:

  • Flexible starting capital support for both lump-sum investments and zero initial capital scenarios
  • Regular savings plans with configurable monthly payment amounts to model systematic investing
  • Multiple compounding intervals supporting monthly, quarterly, and yearly compounding periods
  • Long-term projections with duration support from short-term to multi-decade investment horizons
  • Interest rate sensitivity analysis showing how small changes in returns dramatically impact final wealth
  • Visual data output providing detailed breakdowns of capital growth vs. compound interest accumulation
  • Realistic return modeling with validation for reasonable interest rate ranges (-10000% to 10000%)
import { compoundInterest } from '@finanzfluss/calculators'

const input = {
  startCapital: 5000,
  monthlyPayment: 100,
  durationYears: 10,
  yearlyInterest: 7,
  type: 'monthly', // 'monthly', 'quarterly', or 'yearly'
}

// Validate input and calculate compound interest result
const result = compoundInterest.validateAndCalculate(input)

console.log(result.finalCapital) // Total capital after compound growth
console.log(result.totalPayments) // Sum of all payments made
console.log(result.totalInterest) // Total interest earned through compounding
console.log(result.diagramData) // Detailed growth data for visualization

Savings Calculator

The Sparrechner (https://finanzfluss.de/rechner/sparrechner) is a versatile financial planning tool that calculates any unknown variable in a savings plan when all other variables are provided. It helps users plan their savings goals by solving for end value, starting capital, interest rate, duration, or payment amount.

Key Features:

  • Flexible calculation modes solving for any of five variables: end value, start capital, interest rate, duration, or payment amount
  • Tax-optimized calculations supporting both distributing and accumulating investment types with capital gains tax considerations
  • Partial tax exemption modeling the German partial exemption (Teilfreistellung) for funds
  • Multiple saving intervals supporting both monthly and yearly payment schedules
  • Visual growth tracking providing detailed capital and interest accumulation data for charts
import { savings } from '@finanzfluss/calculators'

const input = {
  output: 'endValue', // What to calculate: 'endValue', 'startValue', 'yearlyInterest', 'monthlyDuration', or 'savingRate'
  startValue: 10000,
  savingRate: 200,
  saveIntervalType: 'monthly', // 'monthly' or 'yearly'
  savingType: 'inAdvance', // 'inAdvance' or 'inArrear'
  yearlyInterest: 7,
  interestIntervalType: 'monthly', // 'monthly', 'quarterly', or 'yearly'
  yearlyDuration: 20,
  considerCapitalGainsTax: true,
  capitalGainsTax: 26.375,
  distributionType: 'accumulating', // 'accumulating' or 'distributing'
  partialExemption: 30,
  useCompoundInterest: true,
}

// Validate input and calculate savings result
const result = savings.validateAndCalculate(input)

console.log(result.endValue) // Final portfolio value
console.log(result.deposits) // Total amount deposited
console.log(result.interestAfterTax) // Net interest earned after tax
console.log(result.yearlyDuration) // Duration in years
console.log(result.monthlyDuration) // Duration in months
console.log(result.diagramData) // Detailed capital and interest growth data

Gross-to-Net Calculator

The Brutto-Netto-Rechner (https://finanzfluss.de/rechner/brutto-netto-rechner) calculates a net salary from gross income, accounting for all German tax and social insurance deductions. It is based on the official pseudo code for tax calculation provided by the German ministry of finance: https://www.bmf-steuerrechner.de/interface/pseudocodes.xhtml.

Key Features:

  • All 6 German tax classes (I-VI) with specific calculations for single, married, and divorced individuals
  • State-specific calculations for all 16 German states including varying church tax rates (8% in Bavaria/Baden-Württemberg, 9% elsewhere)
  • Age-based adjustments including senior citizen tax relief (Altersentlastungsbetrag) for 64+ years
  • Child allowances with support for partial children (e.g., 0.5 children for blended families)
  • Flexible insurance options supporting both public (GKV) and private (PKV) health insurance
  • Comprehensive social insurance including pension, unemployment, and care insurance calculations
import { grossToNet } from '@finanzfluss/calculators'

const input = {
  inputAccountingYear: '2025',
  inputTaxClass: 1,
  inputTaxAllowance: 0,
  inputChurchTax: 0,
  inputState: 'Hamburg',
  inputYearOfBirth: 1990,
  inputChildren: 0,
  inputChildTaxAllowance: 0,
  inputPkvContribution: 0,
  inputEmployerSubsidy: 0,
  inputPensionInsurance: 0,
  inputLevyOne: 0,
  inputLevyTwo: 0,
  inputActivateLevy: 0,
  inputHealthInsurance: 0,
  inputAdditionalContribution: 1.7,
  inputGrossWage: 5000,
  inputPeriod: 2, // 2 = monthly, 1 = yearly
}

// Validate input and calculate gross to net result
const result = grossToNet.validateAndCalculate(input)

console.log(result.outputResNetWageMonth) // Net monthly wage
console.log(result.outputResNetWageYear) // Net yearly wage

Net Policy Calculator

The Rentenversicherung-Rechner (https://finanzfluss.de/rechner/rentenversicherung) compares ETF-based pension insurance policies (Nettopolice) with traditional ETF savings plans for retirement planning.

Key Features:

  • ETF pension insurance analysis comparing net policies vs. direct ETF investments
  • Tax optimization calculations including different taxation rules for insurance vs. investment gains
  • Cost structure analysis factoring in management fees, placement commissions, and ongoing charges
  • Long-term projections with realistic return assumptions (typically 7% for diversified equity portfolios)
  • Flexible withdrawal scenarios supporting both lump-sum and gradual withdrawal strategies
  • Real-world cost modeling using actual insurance product data and fee structures
import { netPolicy } from '@finanzfluss/calculators'

const input = {
  // General inputs
  savingRate: 250,
  duration: 35, // in years
  taxAllowance: 1000,
  additionalIncome: 0,
  capitalGainsTax: 26.375,

  // Policy inputs
  placementCommission: 299,
  savingRateCosts: 4,
  balanceCosts: 0.22,
  fixedCosts: 10,
  minimumCosts: 30,

  // ETF inputs
  ter: 0.2,
  expectedInterest: 7,
  partialExemption: 30,

  // Reallocation inputs
  reallocationOccurrence: 10,
  reallocationRate: 40,
}

// Validate input and calculate net policy result
const result = netPolicy.validateAndCalculate(input)

console.log(result.tableData.netWorth) // Projected net worth over time

Testing

Run the test suite:

pnpm test

Run type checking:

pnpm test:types

Run tests with coverage report:

pnpm test:coverage

License

AGPL-3.0 License © 2025-PRESENT Finflow GmbH