PageSourceSearch

https://kerneltools.dev/assets/PrepaymentCalculator-CJMuRV4l.js

js kerneltools.dev collected 2026-10-02 01:54:15 UTC 4,597 bytes, 1 lines download raw bytes

1import{r as s,j as e,L as C}from"./index-j7I9Tmll.js";import{a as L,e as P,C as A,F as i,b as F,f as o,T,P as $,l as k}from"./ui-BrtddqY1.js";/* empty css                    */const m=t=>`${Math.floor(t/12)} y ${t%12} m`;function K(){const[t,M]=s.useState("3000000"),[c,v]=s.useState("8.5"),[p,N]=s.useState("20"),[x,S]=s.useState("500000"),[f,I]=s.useState("12"),[u,E]=s.useState("0"),[h,w]=s.useState("tenure"),{result:a,error:j}=s.useMemo(()=>L(()=>k(Number(t),Number(c),Number(p)*12,{lumpSum:Number(x),atMonth:Number(f),extraMonthly:Number(u),mode:h})),[t,c,p,x,f,u,h]),n=s.useMemo(()=>{if(!a)return null;const r=P(Number(t),Number(c),a.baseMonths).rows,y=Array.from({length:a.baseMonths/12+1},(l,d)=>d),b=(l,d)=>{var g;return d===0?Number(t):((g=l[d*12-1])==null?void 0:g.balance)??0};return{years:y,base:y.map(l=>b(r,l)),prepaid:y.map(l=>b(a.rows,l))}},[a,t,c]);return e.jsxs(A,{slug:"loan-prepayment-calculator",children:[e.jsxs("div",{className:"calc-layout",children:[e.jsxs("section",{className:"calc-inputs","aria-label":"Loan and part-payment",children:[e.jsx(i,{label:"Loan amount",prefix:"₹",value:t,onChange:M,min:1e5,max:3e7,step:1e5}),e.jsx(i,{label:"Interest rate",suffix:"% p.a.",value:c,onChange:v,min:5,max:20,step:.05}),e.jsx(i,{label:"Loan tenure",suffix:"years",value:p,onChange:N,min:1,max:30}),e.jsx(i,{label:"One-time part-payment",prefix:"₹",value:x,onChange:S,min:0,max:1e7,step:5e4}),e.jsx(i,{label:"Paid after EMI number",value:f,onChange:I,min:1,max:(Number(p)||1)*12,slider:!1,hint:"12 = at the end of the first year."}),e.jsx(i,{label:"Extra every month",prefix:"₹",value:u,onChange:E,min:0,max:2e5,step:1e3,slider:!1}),e.jsx(F,{label:"After the part-payment",value:h,onChange:w,options:[["tenure","Keep EMI, finish sooner"],["emi","Keep end date, lower EMI"]]})]}),e.jsx("section",{className:"calc-results","aria-live":"polite",children:j?e.jsx("p",{className:"calc-error",children:j}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"calc-result-heading",children:[e.jsx("span",{children:"Two repayment paths"}),e.jsx("strong",{children:h==="tenure"?a.monthsSaved?`Loan-free ${m(a.monthsSaved)} sooner`:"Same end date":`EMI ${o(a.emiAfter)} after the part-payment`})]}),e.jsx(T,{items:[["Interest saved",a.interestSaved,!0],["Interest without prepaying",a.baseInterest],["Interest with prepaying",a.interest]]}),e.jsx("p",{className:"calc-note",children:h==="tenure"?e.jsxs(e.Fragment,{children:["The loan ends ",e.jsx("strong",{children:m(a.monthsSaved)})," sooner: after ",m(a.months)," instead of ",m(a.baseMonths),"."]}):e.jsxs(e.Fragment,{children:["Your EMI drops from ",o(a.baseEmi)," to ",e.jsx("strong",{children:o(a.emiAfter)})," after the part-payment",Number(u)>0?`, and the extra monthly payments finish it ${m(a.monthsSaved)} early`:"","."]})}),e.jsxs("p",{className:"calc-note",children:["You prepay ",o(a.prepaid)," in total. Keeping the EMI and finishing sooner usually saves more interest than lowering the EMI."]})]})})]}),n&&e.jsxs("section",{className:"calc-schedule",children:[e.jsx("h2",{children:"Balance left at the end of each year"}),e.jsx($,{label:"Loan balance without prepaying (dashed) and with prepaying (blue)",years:n.years,focus:Math.min(n.years.length-1,Math.ceil(a.months/12)),series:[{label:"Without prepaying",tone:"muted",values:n.base},{label:"With prepaying",tone:"a",values:n.prepaid}]}),e.jsx("div",{className:"calc-table-wrap",children:e.jsxs("table",{className:"calc-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Year"}),e.jsx("th",{children:"Without prepaying"}),e.jsx("th",{children:"With prepaying"})]})}),e.jsx("tbody",{children:n.years.slice(1).map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:r}),e.jsx("td",{children:o(n.base[r])}),e.jsx("td",{children:o(n.prepaid[r])})]},r))})]})})]}),e.jsxs("section",{className:"calc-info",children:[e.jsx("h2",{children:"Part-paying a home loan"}),e.jsx("p",{children:"Money paid on top of your EMIs goes straight to the principal, so every later EMI carries less interest. Early in the loan, when most of each EMI is interest, a part-payment saves the most. Since 1 January 2026, RBI rules bar banks and housing finance companies from charging any prepayment or foreclosure fee on floating-rate loans to individuals. Fixed-rate loans may still carry a fee."}),e.jsxs("p",{children:["Before prepaying, check whether that money would earn more elsewhere after tax, and keep an emergency fund. See your full schedule in the ",e.jsx(C,{to:"/emi-calculator",children:"EMI calculator"}),"."]})]})]})}export{K as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.