三月份个税开始年度清缴了,很多人都好奇自己是退税还是补税,退多少补多少。但是清缴预约时间还没到,只能是心痒痒,于是我写了一个代码方便大家自己计算,用这个代码自己就可以算出来今年可以收到多少退税啦。下面是使用教程:
1.在桌面新建一个文本文档:右击→新建文本文档。
2.把代码复制粘贴进文档(代码见文末)。
3.将文档改为html格式:右击新建文本文档→重命名→文档名字后面加上“.html”
4.双击打开文档可以看到计算器,输入信息(所有信息在个税app上可查)就可以看到自己今年退多少税啦。
下面附上代码:
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.input-group {
margin-bottom: 15px;
}
label {
display: inline-block;
width: 180px;
margin-right: 10px;
}
input {
width: 200px;
padding: 5px;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
margin-top: 10px;
}
#result {
margin-top: 20px;
padding: 15px;
background-color: #f9f9f9;
display: none;
}
2024年度个人所得税计算器
计算结果
应纳税所得额:0 元
适用税率:0%
速算扣除数:0 元
应缴税款:0 元
税后收入:0 元
<script>
// 2024年个人所得税税率表(综合所得适用)
const taxRates = [
{ min: 0, max: 36000, rate: 0.03, deduction: 0 },
{ min: 36000, max: 144000, rate: 0.1, deduction: 2520 },
{ min: 144000, max: 300000, rate: 0.2, deduction: 16920 },
{ min: 300000, max: 420000, rate: 0.25, deduction: 31920 },
{ min: 420000, max: 660000, rate: 0.3, deduction: 52920 },
{ min: 660000, max: 960000, rate: 0.35, deduction: 85920 },
{ min: 960000, max: Infinity, rate: 0.45, deduction: 181920 }
];
function calculateTax() {
// 获取输入值
const income = parseFloat(document.getElementById('income').value) || 0;
const insurance = parseFloat(document.getElementById('insurance').value) || 0;
const deduction = parseFloat(document.getElementById('deduction').value) || 0;
// 计算应纳税所得额
const basicDeduction = 60000; // 基本减除费用
const taxableIncome = income - basicDeduction - insurance - deduction;
// 确定适用税率
let taxInfo = taxRates.find(range => taxableIncome > range.min && taxableIncome <= range.max);
if (!taxInfo) taxInfo = taxRates[taxRates.length - 1];
// 计算应纳税额
const taxAmount = taxableIncome > 0 ?
taxableIncome * taxInfo.rate - taxInfo.deduction : 0;
// 显示结果
document.getElementById('taxableIncome').textContent = Math.max(taxableIncome, 0).toFixed(2);
document.getElementById('taxRate').textContent = (taxInfo.rate * 100).toFixed(0);
document.getElementById('quickDeduction').textContent = taxInfo.deduction.toFixed(2);
document.getElementById('taxAmount').textContent = taxAmount.toFixed(2);
document.getElementById('netIncome').textContent = (income - insurance - taxAmount).toFixed(2);
document.getElementById('result').style.display = 'block';
}
</script>
保证代码无毒,且不会记录个人信息,本人已亲自使用
使用过程中遇到问题欢迎大家在评论区留言~