实际利率(EAR)计算器

名义利率(APR)转实际年利率(EAR),考虑复利频率和费用成本

基本参数
费用成本(可选,用于计算真实借款成本)
💰 费用项目(可填多项)
费用名称金额(元)
计算结果
function calcEAR(apr, freq){ if(freq===0) return Math.exp(apr/100)-1; return Math.pow(1+apr/100/freq, freq)-1; } // 牛顿法求IRR function findIRR(cashflows){ let rate = 0.1; for(let iter=0;iter<200;iter++){ let npv=0,dnpv=0; for(let i=0;i0)fees.push(f);} const totalFees = fees.reduce((a,b)=>a+b,0); const netPrincipal = P - totalFees; // 计算含费用的实际利率(IRR方法) // 现金流:第0期收到净本金netPrincipal,每月还款PMT,最后还清 const monthlyRate_apr = apr/100/12; let pmt; if(monthlyRate_apr===0) pmt=P/months; else{ const f=Math.pow(1+monthlyRate_apr,months); pmt=P*monthlyRate_apr*f/(f-1); } // IRR现金流 const cf=[netPrincipal]; // 第0期:收到净额(正) for(let i=1;i
${fmtPct(earBasic*100)}
基础EAR
(仅考虑复利)
${fmtPct(earWithFees*100)}
真实EAR
(含费用成本)
${totalFees>0?fmt(totalFees):'无'}
总费用金额
`; document.getElementById('compareBox').innerHTML = `

📌 名义利率(APR)

${apr.toFixed(2)}%

复利频率:${freq===0?'连续':freq+'次/年'}

✅ 实际利率(EAR)

${(earWithFees*100).toFixed(2)}%

含${fees.length}项费用,共${fmt(totalFees)}

`; document.getElementById('earDiff').className = 'ear-diff ' + (diff>=0 ? 'diff-high' : 'diff-low'); document.getElementById('earDiff').innerHTML = `⚠️ 费用使实际利率比名义利率${diff>=0?'高':'低'} ${Math.abs(diff).toFixed(2)}个百分点
名义${apr.toFixed(2)}% → 实际${(earWithFees*100).toFixed(2)}%`; const freqName={1:'年',2:'半年',4:'季度',12:'月',365:'日',0:'连续'}[freq]||freq+''; document.getElementById('formulaBox').innerHTML = `

计算过程详解

第一步:基础EAR(仅复利效应)

${freq===0 ?`EAR = e^(${(apr/100).toFixed(6)}) - 1 = ${(earBasic*100).toFixed(4)}%` :`EAR = (1 + ${apr}%/${freq})^${freq} - 1 = ${(earBasic*100).toFixed(4)}%`}

第二步:考虑费用后的真实成本

• 贷款面额:${fmt(P)} → 扣除费用后实得:${fmt(netPrincipal)}

• 总费用:${fees.length}项 = ${fmt(totalFees)}(占面额${((totalFees/P)*100).toFixed(2)}%)

• 月供按名义利率计算:${fmt(pmt)}/月 × ${months}个月

• 用IRR法反推实际月利率:${(irrMonthly*100).toFixed(4)}%/月

• 年化实际利率:(1+${(irrMonthly*100).toFixed(4)}%)^12 - 1 = ${(earWithFees*100).toFixed(4)}%

结论:由于${totalFees>0?'费用拉高了实际成本':'无额外费用'},真实年化利率为 ${(earWithFees*100).toFixed(4)}%

`; document.getElementById('resultArea').classList.add('show'); }