How I Built a Free, Ad-Free Loan Calculator Using Pure HTML, Chart.js, and AI
Have you ever tried to use a simple online loan calculator, only to be hit with intrusive pop-ups, banner ads, and a mandatory signup form? I got tired of it.
As an indie developer, I wanted to build a tool that just works. No signups, no servers, no tracking. Everything runs locally in your browser.
Here is how I built the Loan Calculator on Lihayo Tools using pure HTML, Chart.js, and AI.
The Core: Pure Client-Side JavaScript
The most important rule was "no backend." Every calculation happens on the user's device. This guarantees 100% privacy. When a user enters their loan amount, interest rate, and term, the JavaScript instantly calculates the amortization formula: M = P * r * (1 + r)^n / ((1 + r)^n - 1).
Visualizing the Data with Chart.js
Numbers alone can be boring. To help users understand how much of their payment goes to interest vs. principal, I integrated Chart.js. A simple doughnut chart updates in real-time as the user types. It makes the financial reality very clear.
Generating the Amortization Schedule
Users don't just want the monthly payment; they want the full breakdown. Using a simple JavaScript loop, the app generates a month-by-month table showing the payment date, principal portion, interest portion, and remaining balance.
Using AI to Accelerate Development
I am a solo developer, and AI (like DeepSeek and ChatGPT) was my co-pilot. I used AI to quickly scaffold the HTML structure, write the CSS variables for a clean UI, and debug the date overflow issues in the amortization table.
The Result
You can try the final product here. It is completely free, loads instantly, and has zero ads (for now, I might add minimal Google AdSense to keep the lights on).
Check out the tool here: https://app.lihayo.com/loan/
Building tools in public is an amazing experience. If you have any feedback on the UI or the math, let me know!