Current Status: Active Development. See Roadmap & Tracks.
A professional-grade Rent vs. Buy calculator designed for the UK market. Unlike simple mortgage calculators, this tool simulates 40-year wealth projections considering complex tax rules, inflation, and opportunity costs.
👉 Try the Live App: https://itsmuaaz.github.io/rent-vs-buy/
Most calculators just compare "Mortgage vs Rent". This tool goes deeper, modeling your entire financial life over 40 years to answer: * "Am I better off buying a home, or renting and investing the difference in the S&P 500?"*
- Multi-Strategy Comparison: Compare 6 different financial paths simultaneously:
- Rent & Invest
- Buy Home
- Buy Home + Lodger (Tax-free income)
- Buy-to-Let (Personal Name)
- Buy-to-Let (Limited Company)
- Home + Buy-to-Let Combo
- Transparency Mode (Audit): Click the "Audit" button to see exactly how your numbers were calculated (Stamp Duty, Amortization, Tax) with step-by-step proofs.
- True Valuation Modes: Toggle between Gross Equity (Paper Wealth) and Liquid Cash (What you'd actually have if you sold everything today, after paying all taxes and fees).
- Advanced UK Tax Engine: Accurately models:
- Stamp Duty Land Tax (SDLT) including Additional Dwelling Supplement.
- Section 24 (Mortgage Interest Relief restrictions).
- Capital Gains Tax & Dividend Tax.
- Corporation Tax for Ltd Companies.
- Stress Testing: One-click simulation of market crashes (Stock Market -30% or Property Market -15%) to see if your strategy survives a recession.
- Core Logic: Pure JavaScript (
engine.js). No DOM dependencies. 100% unit-tested. - Audit Layer:
audit.jsprovides the Logic Dictionary for transparency. - UI Framework: Alpine.js for reactive state management.
- Styling: TailwindCSS (CDN for zero-build setup).
- Visualization: Chart.js.
- Testing: Jest for logic verification + Husky for pre-commit hooks.
- Type Safety: TypeScript (JSDoc) +
npm run typecheck.
The project follows a strict "Engine vs. Dashboard" separation of concerns:
engine.js: The source of truth. Contains all financial formulas and simulation loops. It is stateless and platform-agnostic (runs in Browser and Node.js).app.js: The controller. Connects the UI inputs to the Engine and handles Chart.js updates.index.html: The view.
- Clone the repository.
- Run
npm installto setup testing tools. - Open
index.htmlin your browser (no build step required). - Run
npm testbefore committing to ensure calculation integrity. - Run
npm run typecheckto verify JSDoc types.
This entire project was developed on Android using Termux. It serves as a demonstration of what's possible with a powerful terminal environment on mobile.
If you are interested in turning your Android device into a development machine, check out my other project: 👉 termux-bootstrap