Rule of 72 — approximate years to double an investment at a given rate. Plus exact ln(2) version. MIT.
Project description
calcfi-rule-of-72
Rule of 72 — approximate years to double an investment at a given rate. Plus exact ln(2) version. MIT.
CalcFi Rule of 72 Calculator — a single-purpose, MIT-licensed helper for Compute years to double an investment using the classic Rule of 72 approximation (years = 72 / rate%) plus the exact natural-log formula. Useful for quick mental math on compound returns.
What this does
Compute years to double an investment using the classic Rule of 72 approximation (years = 72 / rate%) plus the exact natural-log formula. Useful for quick mental math on compound returns.
Formula — Approximate doubling time:
years = 72 / rate% (approximation) | years = ln(2) / ln(1+r) (exact)
Primary source: Standard textbook (originally attributed to Luca Pacioli, 1494)
Install
pip install calcfi-rule-of-72
Usage
from calcfi_rule_of_72 import rule_of_72, exact_doubling_time
# At 8% return, years to double
rule_of_72(8) # 9.0 (approximation)
exact_doubling_time(8) # 9.006 (exact)
Live calculator
Try the interactive web calculator with full UI at https://calcfi.app/calculators/rule-of-72 — no signup required.
Why this package exists
Most personal-finance calculators are buried in advertising-heavy lead-generation sites. The math is freely published by federal agencies and textbooks, but the implementations are wrapped in proprietary opaque code. CalcFi publishes these utility libraries to make every formula:
- Reproducible — show the math
- Cited — link to primary sources
- Free — MIT license, no paid tier
- Auditable — every line of code is open source
The math here is undergraduate-level. The contribution is the citation discipline and the open distribution.
Part of the CalcFi ecosystem
This package is one of 8 single-purpose helper utilities. Cross-mesh:
Sibling Python packages
- calcfi-mortgage-payment — Standard amortizing-loan monthly payment formula. Free, cited, MIT.
- calcfi-compound-interest — Compound interest with periodic contributions. Future value, present value, time-to-target. Free, MIT.
- calcfi-apr-apy — Convert between APR (simple annual rate) and APY (effective annual yield including compounding). MIT.
- calcfi-real-return — Inflation-adjusted (real) return from nominal return. Formula: real = (1+nominal)/(1+inflation) − 1. MIT.
- calcfi-amortization — Generate a full amortization schedule for a fixed-rate loan: payment, principal, interest, balance per period. MIT.
- calcfi-tax-bracket — US federal income tax bracket math — marginal rate, effective rate, total tax owed. 2024-2026 brackets per IRS Rev. Proc. MIT.
- calcfi-debt-payoff — Snowball vs avalanche debt payoff strategies. Compute months and total interest. MIT.
Sibling npm packages
- calcfi-mortgage-payment — Standard amortizing-loan monthly payment formula. Free, cited, MIT.
- calcfi-compound-interest — Compound interest with periodic contributions. Future value, present value, time-to-target. Free, MIT.
- calcfi-apr-apy — Convert between APR (simple annual rate) and APY (effective annual yield including compounding). MIT.
- calcfi-real-return — Inflation-adjusted (real) return from nominal return. Formula: real = (1+nominal)/(1+inflation) − 1. MIT.
- calcfi-amortization — Generate a full amortization schedule for a fixed-rate loan: payment, principal, interest, balance per period. MIT.
- calcfi-tax-bracket — US federal income tax bracket math — marginal rate, effective rate, total tax owed. 2024-2026 brackets per IRS Rev. Proc. MIT.
- calcfi-debt-payoff — Snowball vs avalanche debt payoff strategies. Compute months and total interest. MIT.
Companion data
The mortgage rate, inflation, Treasury yield, and macro data used to validate these calculators are published as CalcFi Open Data — 34 free CC BY 4.0 time series, 117,956 observations, 5 permanent DOIs.
- CalcFi Open Data on Hugging Face
- Python
calcfidataSDK - npm
calcfidataSDK - Live SQL endpoint (Datasette)
- DOI 10.6084/m9.figshare.32332290
Calculators on CalcFi (free, no signup)
Every formula in these packages has a live web calculator at calcfi.app:
- Mortgage Payment
- Compound Interest
- Tax Bracket
- Amortization Schedule
- APR vs APY
- Rule of 72
- Inflation-Adjusted Return
- Debt Payoff
License
MIT. Author: Jere Salmisto (ORCID 0009-0000-0916-8684), founder of CalcFi. Based in Helsinki, Finland.
Citation
If you cite this package in research:
Salmisto, J. (2026). calcfi-rule-of-72: CalcFi Rule of 72 Calculator.
DOI: 10.6084/m9.figshare.32332290 (parent CalcFi Open Data dataset).
Available: https://calcfi.app/calculators/rule-of-72
Or use the CITATION.cff on the parent dataset for the BibTeX entry.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file calcfi_rule_of_72-0.1.0.tar.gz.
File metadata
- Download URL: calcfi_rule_of_72-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14c36e2d82bea103caf53b7c7d80c51d98b398669c7f23cddfcb16110200068f
|
|
| MD5 |
9eb5d9ba87472630e2ad163a18627d73
|
|
| BLAKE2b-256 |
f324a29b93e2dea62cbf5c2281a68762fda0bc1f7e58da996858f9e06a5e9a6a
|
File details
Details for the file calcfi_rule_of_72-0.1.0-py3-none-any.whl.
File metadata
- Download URL: calcfi_rule_of_72-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34b8adc930e5928d130e6aa5db70e4cac0a3f4b6bb18aae8b1e4c3e423358c6d
|
|
| MD5 |
6fc7cb83bce0df862d4cfff76fe7a366
|
|
| BLAKE2b-256 |
3620997946b361dcedb080c8a96da6f883fa6616e37b993ed42590612b6d0697
|