PageSourceSearch

https://technotize.io/assets/tools_.irr-calculator-DtDQWcRg.js

js technotize.io collected 2026-10-06 00:23:03 UTC 12,500 bytes, 1 lines download raw bytes

1import{r as o,j as e,L as F,ab as Y,B as W}from"./main-DjLrVMmH.js";import{S as M}from"./Section-93gGzN8K.js";import{H as z}from"./HeroGlassDecor-ByfJ96oa.js";import{R as d,F as c}from"./CalcUI-BUOqTltv.js";import{C as U}from"./check-D8NBmQRQ.js";import{C as D}from"./copy-DZGh4Eth.js";import{A as H}from"./arrow-up-right-Bi1HdmmV.js";import"./utils-0exNfmSl.js";import"./clsx-B-dksMZM.js";import"./useReveal-BeCECswb.js";import"./createLucideIcon-DeZVzkPI.js";const G=[{name:"NPV Calculator",desc:"Net present value",slug:"/tools/npv-calculator"},{name:"WACC Calculator",desc:"Cost of capital",slug:"/tools/wacc-calculator"},{name:"CAC Payback Calculator",desc:"Months to recover CAC",slug:"/tools/cac-payback-calculator"}];function de(){const[p,Q]=o.useState(0),[g,A]=o.useState(""),[f,V]=o.useState(""),[b,B]=o.useState(""),[y,P]=o.useState(""),[j,E]=o.useState(""),[v,$]=o.useState(""),[k,R]=o.useState(!1),i=o.useMemo(()=>{if(p===0){const a=n=>"$"+Math.round(n).toLocaleString("en-US");return(n=>{const m=parseFloat(n.init);if(!Number.isFinite(m))return null;if(m<=0)return{kind:"err",err:"Enter initial investment above 0."};const h=(l,r)=>{const t=parseFloat(l);return Number.isFinite(t)?t:r},C=[h(n.y1,0),h(n.y2,0),h(n.y3,0),h(n.y4,0),h(n.y5,0)],I=C.reduce((l,r)=>l+r,0);if(I<=0)return{kind:"err",err:"Enter at least one positive yearly cash flow."};const S=[-m,...C],N=l=>{let r=0;for(let t=0;t<S.length;t++)r+=S[t]/Math.pow(1+l,t);return r};let u=-.9999,x=10,w=N(u),T=N(x);if(w*T>0)return{kind:"err",err:"No IRR in range. Check that inflows exceed the initial investment."};for(let l=0;l<200;l++){const r=(u+x)/2,t=N(r);if(Math.abs(t)<1e-7)break;w*t<0?(x=r,T=t):(u=r,w=t)}const L=(u+x)/2*100;return{kind:"ok",big:L.toFixed(2)+"%",aL:"Initial",aV:a(m),bL:"Total inflows",bV:a(I),label:"Calculated",note:"IRR is the discount rate that makes the net present value zero. Compare to your cost of capital: above WACC, the investment creates value; below it, it does not.",summary:"IRR "+L.toFixed(2)+"%."}})({init:g,y1:f,y2:b,y3:y,y4:j,y5:v})}return null},[p,g,f,b,y,j,v]),s=i&&i.kind==="ok"?i:null,_=i&&i.kind==="err"?i.err:null;async function q(){if(s)try{await navigator.clipboard.writeText(s.summary),R(!0),setTimeout(()=>R(!1),1600)}catch{}}return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"relative overflow-hidden bg-[#201515] text-white",children:[e.jsx(z,{variant:"light"}),e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -top-40 -left-40 h-[700px] w-[700px] rounded-full",style:{background:"radial-gradient(circle at center, rgba(255,79,0,0.18), transparent 65%)",filter:"blur(40px)"}}),e.jsxs("div",{className:"relative mx-auto max-w-[1280px] px-6 pt-16 sm:px-8 lg:pt-24",style:{paddingBottom:"70px"},children:[e.jsxs("nav",{"aria-label":"Breadcrumb",className:"t-eyebrow text-white/50",children:[e.jsx(F,{to:"/",className:"hover:text-white",children:"Home"}),e.jsx("span",{className:"mx-2 text-white/30",children:"/"}),e.jsx(F,{to:"/tools",className:"hover:text-white",children:"Tools"}),e.jsx("span",{className:"mx-2 text-white/30",children:"/"}),e.jsx("span",{className:"text-white/80",children:"IRR"})]}),e.jsx("h1",{className:"animate-rise-delay-1 t-display mt-8 max-w-[22ch] text-white",children:"IRR (Internal Rate of Return) Calculator"}),e.jsx("p",{className:"animate-rise-delay-2 t-body-l mt-8 max-w-[720px] text-white/70",children:"Enter an investment and yearly cash flows. Get the return, solved for you."})]})]}),e.jsx("span",{id:"calculator",className:"block","aria-hidden":!0}),e.jsx(M,{className:"relative overflow-hidden",children:e.jsx(d,{children:e.jsxs("div",{className:"grid gap-px border border-border bg-border lg:grid-cols-12",children:[e.jsxs("div",{className:"bg-background p-8 lg:col-span-7 lg:p-10",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"t-eyebrow text-muted-foreground",children:"Inputs"}),e.jsx("span",{className:"h-px w-12 bg-accent"})]}),e.jsx("div",{className:"mt-8 grid gap-5 sm:grid-cols-2",children:p===0?e.jsxs(e.Fragment,{children:[e.jsx(c,{id:"m0_init",label:"Initial investment",affix:"$",value:g,onChange:A,placeholder:"1,000"}),e.jsx(c,{id:"m0_y1",label:"Year 1",affix:"$",value:f,onChange:V,placeholder:"500"}),e.jsx(c,{id:"m0_y2",label:"Year 2",affix:"$",value:b,onChange:B,placeholder:"500"}),e.jsx(c,{id:"m0_y3",label:"Year 3",affix:"$",value:y,onChange:P,placeholder:"500"}),e.jsx(c,{id:"m0_y4",label:"Year 4",affix:"$",value:j,onChange:E,placeholder:"0"}
1),e.jsx(c,{id:"m0_y5",label:"Year 5",affix:"$",value:v,onChange:$,placeholder:"0"})]}):null}),e.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-between gap-3 border-t border-border pt-5",children:[e.jsxs("button",{type:"button",onClick:q,disabled:!s,className:"inline-flex items-center gap-2 rounded-md border border-border px-4 py-2 t-eyebrow text-foreground/80 transition-colors hover:border-foreground hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[k?e.jsx(U,{className:"h-3.5 w-3.5"}):e.jsx(D,{className:"h-3.5 w-3.5"}),k?"Copied":"Copy result"]}),e.jsx("span",{className:"t-eyebrow text-muted-foreground",children:"Formula · Rate where NPV = 0"})]})]}),e.jsxs("div",{className:"bg-background p-8 lg:col-span-5 lg:p-10 border-l-4",style:{borderLeftColor:"var(--accent)"},children:[e.jsx("p",{className:"t-eyebrow text-muted-foreground",children:"Result"}),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-display mt-4 text-5xl md:text-6xl leading-none tracking-tight text-foreground tabular-nums",children:s.big}),e.jsxs("p",{className:"t-body-s mt-3 text-muted-foreground tabular-nums",children:[e.jsx("b",{className:"font-semibold text-foreground/80",children:s.aL})," ",s.aV," · ",e.jsx("b",{className:"font-semibold text-foreground/80",children:s.bL})," ",s.bV]}),e.jsx("span",{className:"mt-5 inline-block rounded-full border px-3 py-1 t-eyebrow",style:{color:"var(--accent)",borderColor:"var(--border)"},children:s.label}),e.jsx("p",{className:"t-body mt-5 text-muted-foreground",children:s.note})]}):_?e.jsx("p",{className:"t-body mt-4 text-muted-foreground",children:_}):e.jsx("p",{className:"t-body mt-4 text-muted-foreground",children:"Fill the inputs to see your result."})]})]})})}),e.jsxs("section",{className:"relative overflow-hidden border-y border-border bg-secondary/40",children:[e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-dots opacity-30"}),e.jsx("div",{className:"relative mx-auto max-w-3xl px-6 py-20 lg:px-8 lg:py-28",children:e.jsx(d,{children:e.jsxs("article",{className:"space-y-12",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"t-h2 text-foreground",children:"What is the internal rate of return?"}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"The internal rate of return, or IRR, is the discount rate at which a project's net present value equals zero. It expresses an investment's return as a single annual percentage."}}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"It is the rate the investment effectively earns. That makes it intuitive to compare against a benchmark: if the IRR beats your cost of capital, the investment is worth making."}})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"t-h2 text-foreground",children:"How IRR is calculated."}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"IRR is the rate that solves net present value equals zero across the cash flows. There is no clean formula for it, so it is found numerically, and this tool solves it by searching for the rate that zeroes the NPV."}}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"You provide the upfront investment and the yearly cash flows; the tool does the iteration. Because it is a search, IRR needs a sign change in the cash flows, an outflow followed by inflows, to exist."}})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"t-h2 text-foreground",children:"A worked example."}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"Invest 1,000 today and receive 500 a year for three years. The IRR, the rate that makes those discounted inflows exactly equal the 1,000, works out to about 23.4%."}})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"t-h2 text-foreground",children:"What is a good IRR?"}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"The benchmark is your cost of capital: an IRR above WACC means the investment earns more than it costs to fund, and a higher spread is better. There is no universal number, since the right bar depends on the business and the risk of the cash flows."}}
1),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:'IRR and NPV are two views of the same cash flows. Comparing it with <a href="/tools/cac-payback-calculator" class="text-foreground underline underline-offset-4 hover:text-accent">how fast acquisition pays back</a> grounds the return in a familiar SaaS measure.'}})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"t-h2 text-foreground",children:"How it is used."}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:"Use IRR to compare investments against a hurdle rate and against each other, accepting those whose IRR clears your cost of capital. Treat it as one of two lenses, alongside NPV, rather than the only one."}}),e.jsx("p",{className:"t-body mt-4 text-muted-foreground",dangerouslySetInnerHTML:{__html:'For an operating business, the returns that clear the hurdle come from growth that does not consume cash to produce, which is part of the case for <a href="/b2b-saas-seo" class="text-foreground underline underline-offset-4 hover:text-accent">returns that clear the hurdle</a>.'}})]})]})})})]}),e.jsxs(M,{className:"relative overflow-hidden",children:[e.jsx(d,{children:e.jsx("h2",{className:"t-h2 text-foreground",children:"Related calculators"})}),e.jsx(d,{children:e.jsx("div",{className:"mt-12 grid gap-px border border-border bg-border sm:grid-cols-2 lg:grid-cols-3",children:G.map(a=>e.jsxs("a",{href:a.slug,className:"group flex flex-col bg-background p-7 transition-colors hover:bg-foreground",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"t-eyebrow text-accent",children:"Valuation"}),e.jsx(H,{className:"h-4 w-4 text-muted-foreground transition-all group-hover:-translate-y-0.5 group-hover:translate-x-0.5 group-hover:text-background"})]}),e.jsx("h3",{className:"t-h4 mt-6 text-foreground transition-colors group-hover:text-background",children:a.name}),e.jsx("p",{className:"t-body-s mt-3 text-muted-foreground transition-colors group-hover:text-background/70",children:a.desc})]},a.slug))})})]}),e.jsxs("section",{className:"relative overflow-hidden border-y border-border bg-secondary/40",children:[e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-dots opacity-30"}),e.jsx("div",{className:"relative mx-auto max-w-7xl px-6 py-20 lg:px-8 lg:py-28",children:e.jsxs("div",{className:"grid gap-10 lg:grid-cols-12",children:[e.jsx(d,{className:"lg:col-span-4",children:e.jsx("h2",{className:"t-h2 text-foreground",children:"FAQ"})}),e.jsx(d,{className:"lg:col-span-8",children:e.jsx("dl",{className:"border-t border-border",children:Y.map(a=>e.jsxs("div",{className:"border-b border-border py-6",children:[e.jsx("dt",{className:"t-h4 text-foreground",children:a.q}),e.jsx("dd",{className:"t-body mt-3 text-muted-foreground",children:a.a})]},a.q))})})]})})]}),e.jsxs("section",{className:"relative overflow-hidden bg-foreground text-background",children:[e.jsx("div",{className:"absolute inset-0 bg-grid opacity-30","aria-hidden":!0}),e.jsxs("div",{className:"relative mx-auto grid max-w-7xl gap-12 px-6 py-24 lg:grid-cols-12 lg:px-8 lg:py-32",children:[e.jsx("div",{className:"lg:col-span-8",children:e.jsx("h2",{className:"t-h1 text-background",children:"Book a strategy call."})}),e.jsx("div",{className:"flex flex-wrap items-end gap-3 lg:col-span-4 lg:justify-end",children:e.jsxs(W,{className:"t-body inline-flex items-center gap-2 rounded-md bg-accent px-6 py-4 font-medium text-background transition-opacity hover:opacity-90",children:["Book a 30-min call ",e.jsx(H,{className:"h-4 w-4"})]})})]})]})]})}export{de as component};

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.