Income Tax Calculator Ay 2025 26

Income Tax Calculator AY 2025-26 | Calculate Your Tax Liability :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 1.5em; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; border-bottom: 2px solid var(–primary-color); padding-bottom: 0.5em; } h3 { font-size: 1.4em; margin-top: 1.5em; } .calculator-section { margin-bottom: 40px; padding: 30px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } .input-group { margin-bottom: 20px; display: flex; flex-direction: column; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: 100%; padding: 12px; border: 1px solid var(–border-color); border-radius: 4px; box-sizing: border-box; font-size: 1em; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; } .error-message { color: #dc3545; font-size: 0.85em; margin-top: 5px; display: none; /* Hidden by default */ } .error-message.visible { display: block; } .button-group { display: flex; justify-content: space-between; margin-top: 25px; flex-wrap: wrap; gap: 10px; } .button-group button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; flex: 1; min-width: 150px; } #calculateBtn { background-color: var(–primary-color); color: white; } #calculateBtn:hover { background-color: #003366; } #resetBtn { background-color: #6c757d; color: white; } #resetBtn:hover { background-color: #5a6268; } #copyBtn { background-color: var(–success-color); color: white; } #copyBtn:hover { background-color: #218838; } .results-section { margin-top: 30px; padding: 25px; background-color: #e9ecef; border-radius: 8px; border: 1px solid #dee2e6; } .results-section h3 { margin-top: 0; color: var(–primary-color); text-align: left; } .result-item { margin-bottom: 15px; font-size: 1.1em; } .result-item strong { color: var(–primary-color); min-width: 200px; display: inline-block; } .highlight-result { background-color: var(–success-color); color: white; padding: 15px; border-radius: 5px; text-align: center; margin-bottom: 20px; font-size: 1.4em; font-weight: bold; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); } .highlight-result span { display: block; font-size: 0.8em; font-weight: normal; margin-top: 5px; } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 15px; padding-top: 10px; border-top: 1px dashed #ccc; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: var(–shadow); } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead th { background-color: var(–primary-color); color: white; font-weight: bold; } tbody tr:nth-child(even) { background-color: #f2f2f2; } tbody td { background-color: var(–card-background); } .table-container { overflow-x: auto; /* Mobile responsiveness for tables */ } canvas { max-width: 100%; /* Mobile responsiveness for charts */ height: auto; display: block; margin: 20px auto; background-color: var(–card-background); border-radius: 5px; box-shadow: var(–shadow); } .chart-legend { text-align: center; margin-top: 10px; font-size: 0.9em; color: #555; } .chart-legend span { display: inline-block; margin: 0 10px; } .chart-legend .color-box { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: middle; border-radius: 3px; } .article-content { margin-top: 40px; padding: 30px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } .article-content h2, .article-content h3 { text-align: left; margin-bottom: 1em; } .article-content p { margin-bottom: 1.2em; } .article-content ul, .article-content ol { margin-bottom: 1.2em; padding-left: 25px; } .article-content li { margin-bottom: 0.5em; } .faq-item { margin-bottom: 15px; } .faq-item strong { display: block; color: var(–primary-color); cursor: pointer; margin-bottom: 5px; } .faq-item p { margin-bottom: 0; padding-left: 15px; border-left: 3px solid var(–primary-color); } .internal-links { margin-top: 30px; padding: 25px; background-color: #e9ecef; border-radius: 8px; border: 1px solid #dee2e6; } .internal-links h3 { text-align: left; margin-top: 0; } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links p { font-size: 0.9em; color: #555; margin-top: 5px; } @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } h1 { font-size: 1.8em; } h2 { font-size: 1.5em; } .button-group button { flex: 1 1 100%; min-width: unset; } .results-section .result-item strong { min-width: auto; display: block; margin-bottom: 5px; } }

Income Tax Calculator AY 2025-26

Estimate your income tax liability for the Assessment Year 2025-26 (Financial Year 2024-25) with our easy-to-use calculator.

Income Tax Calculator

Include salary, business income, capital gains, etc., after eligible deductions.
Resident Individual Non-Resident Individual
Below 60 years 60 to 80 years Above 80 years
Old Tax Regime New Tax Regime (Default)
Choose the regime that offers lower tax. The new regime is the default from FY 2023-24.

Your Tax Calculation Summary

₹0.00 Estimated Income Tax Payable
Taxable Income: ₹0.00
Basic Tax Payable: ₹0.00
Surcharge: ₹0.00
Health & Education Cess (4%): ₹0.00
Total Tax Payable: ₹0.00
Formula Used: Taxable Income is determined based on your input. Basic tax is calculated using the applicable tax slabs for the chosen regime, age, and residency. Surcharge is applied if taxable income exceeds certain thresholds. Finally, a 4% Health & Education Cess is added to the total tax and surcharge.

Tax Slab Comparison (AY 2025-26)

New Tax Regime (Default)
Income Slab (₹) Tax Rate (%)
0 – 3,00,0000%
3,00,001 – 6,00,0005%
6,00,001 – 9,00,00010%
9,00,001 – 12,00,00015%
12,00,001 – 15,00,00020%
Above 15,00,00030%
Old Tax Regime (Illustrative – Assumes no deductions claimed)
Income Slab (₹) Tax Rate (%)
0 – 2,50,0000%
2,50,001 – 5,00,0005%
5,00,001 – 10,00,00020%
Above 10,00,00030%

Note: For individuals aged 60-80, the basic exemption limit is ₹3,00,000. For those above 80, it's ₹5,00,000 under the Old Tax Regime. Rebate under Section 87A is available if taxable income does not exceed ₹7,00,000 (New Regime) or ₹5,00,000 (Old Regime, if applicable). This calculator assumes no rebate is claimed for simplicity in displaying core tax calculation.

Tax Liability Breakdown Chart

Basic Tax Surcharge Cess

What is an Income Tax Calculator AY 2025-26?

An Income Tax Calculator AY 2025-26 is a digital tool designed to help individuals estimate their income tax liability for the Assessment Year 2025-26, which corresponds to the Financial Year 2024-25. This calculator simplifies the complex process of tax computation by taking into account various income sources, applicable tax slabs, and the choice between the old and new tax regimes. It provides a clear, estimated figure of the total tax payable, aiding in financial planning and ensuring compliance with tax laws. Understanding your potential tax burden is crucial for budgeting, investment decisions, and avoiding last-minute tax-related stress. This specific income tax calculator AY 2025-26 is tailored to the tax rules effective for the fiscal year ending March 31, 2025.

Who should use it? Any individual resident in India who earns income from salary, business, profession, capital gains, or other sources and is liable to pay income tax should use this calculator. This includes salaried employees, freelancers, business owners, and investors. It's particularly useful for those who want to get a quick estimate without delving into complex tax forms or consulting a tax professional for preliminary figures. It helps in comparing the tax outgo under the old and new tax regimes to choose the more beneficial one.

Common misconceptions: A common misconception is that the calculator provides a definitive, legally binding tax amount. It's an estimate based on the inputs provided and the prevailing tax laws. Actual tax liability might differ due to specific deductions, exemptions, or changes in tax laws. Another misconception is that the calculator accounts for all possible deductions and offers tax-saving advice; this tool primarily focuses on calculating tax based on provided taxable income and regime choice.

Income Tax Calculator AY 2025-26 Formula and Mathematical Explanation

The calculation performed by the income tax calculator AY 2025-26 follows a structured approach based on Indian income tax laws. The core formula involves determining the taxable income, applying the relevant tax rates based on the chosen regime, age, and residency, and then adding surcharge (if applicable) and cess.

Step-by-step derivation:

  1. Determine Taxable Income: This is the income after all eligible deductions and exemptions have been applied to your gross total income. For this calculator, we assume the user inputs the final 'Total Taxable Income'.
  2. Apply Tax Slabs: The taxable income is then taxed according to the specific tax slabs defined for the chosen tax regime (Old or New), age group (below 60, 60-80, above 80), and residency status.
  3. Calculate Basic Tax: The tax calculated based on the slabs is the basic tax payable.
  4. Calculate Surcharge: If the total taxable income exceeds certain thresholds (e.g., ₹50 Lakhs), a surcharge is levied on the basic tax. The rates vary based on the income level. For simplicity in this calculator, we'll focus on the standard rates applicable for most individuals.
  5. Calculate Health & Education Cess: A 4% cess is applied to the sum of the basic tax and any applicable surcharge.
  6. Total Tax Payable: This is the final amount of income tax due.

Variable Explanations:

Variables Used in Income Tax Calculation
Variable Meaning Unit Typical Range
Total Taxable IncomeIncome after all deductions and exemptions₹0 – ₹1,00,00,000+
Residency StatusIndividual's tax residency in IndiaCategoryResident, Non-Resident
AgeAge of the individual as of March 31st of the assessment yearYears0 – 100+
Tax RegimeChoice between Old and New tax structuresCategoryOld, New
Basic TaxTax calculated on income slabs₹0 – Varies
SurchargeAdditional tax on higher incomes% of Basic Tax0% to 25% (depending on income)
Health & Education CessMandatory cess on tax and surcharge4%4%
Total Tax PayableFinal tax liability₹0 – Varies

The specific tax slabs for AY 2025-26 are detailed in the calculator's interface and the accompanying tables. The income tax calculator AY 2025-26 aims to accurately reflect these slabs.

Practical Examples (Real-World Use Cases)

Let's illustrate how the income tax calculator AY 2025-26 works with practical examples:

Example 1: Salaried Individual – New Regime

Scenario: Mr. Rohan, a 35-year-old resident individual, has a total taxable income of ₹12,50,000 for FY 2024-25. He opts for the New Tax Regime.

Inputs:

  • Total Taxable Income: ₹12,50,000
  • Residency Status: Resident
  • Age: Below 60 years
  • Tax Regime: New Tax Regime

Calculation Steps (Illustrative):

  • Income Slab 1 (0-3,00,000): 0% tax = ₹0
  • Income Slab 2 (3,00,001-6,00,000): 5% on ₹3,00,000 = ₹15,000
  • Income Slab 3 (6,00,001-9,00,000): 10% on ₹3,00,000 = ₹30,000
  • Income Slab 4 (9,00,001-12,00,000): 15% on ₹3,00,000 = ₹45,000
  • Remaining Income (12,00,001-12,50,000): 20% on ₹50,000 = ₹10,000
  • Basic Tax: ₹15,000 + ₹30,000 + ₹45,000 + ₹10,000 = ₹1,00,000
  • Surcharge: Nil (Income below ₹50 Lakhs)
  • Health & Education Cess (4%): 4% of ₹1,00,000 = ₹4,000
  • Total Tax Payable: ₹1,00,000 + ₹4,000 = ₹1,04,000

Calculator Output:

  • Estimated Income Tax Payable: ₹1,04,000
  • Taxable Income: ₹12,50,000
  • Basic Tax Payable: ₹1,00,000
  • Surcharge: ₹0
  • Health & Education Cess (4%): ₹4,000

Financial Interpretation: Mr. Rohan's estimated tax liability under the new regime is ₹1,04,000. This figure helps him plan his finances accordingly.

Example 2: Senior Citizen – Old Regime (Illustrative)

Scenario: Mrs. Sharma, a 70-year-old resident individual, has a total taxable income of ₹8,50,000. She believes the Old Tax Regime might be more beneficial for her due to potential deductions she might claim (though this calculator assumes no deductions for simplicity in calculation). Let's see the tax under the old regime slabs.

Inputs:

  • Total Taxable Income: ₹8,50,000
  • Residency Status: Resident
  • Age: 60 to 80 years
  • Tax Regime: Old Tax Regime

Calculation Steps (Illustrative):

  • Basic Exemption Limit for Senior Citizen (Old Regime): ₹3,00,000
  • Income Slab 1 (0-3,00,000): 0% tax = ₹0
  • Income Slab 2 (3,00,001-5,00,000): 5% on ₹2,00,000 = ₹10,000
  • Income Slab 3 (5,00,001-10,00,000): 20% on ₹3,50,000 (₹8,50,000 – ₹5,00,000) = ₹70,000
  • Basic Tax: ₹10,000 + ₹70,000 = ₹80,000
  • Surcharge: Nil (Income below ₹50 Lakhs)
  • Health & Education Cess (4%): 4% of ₹80,000 = ₹3,200
  • Total Tax Payable: ₹80,000 + ₹3,200 = ₹83,200

Calculator Output:

  • Estimated Income Tax Payable: ₹83,200
  • Taxable Income: ₹8,50,000
  • Basic Tax Payable: ₹80,000
  • Surcharge: ₹0
  • Health & Education Cess (4%): ₹3,200

Financial Interpretation: In this scenario, the old regime results in a slightly lower tax (₹83,200) compared to the new regime's potential calculation for the same income (which would be higher). This highlights the importance of comparing regimes. However, Mrs. Sharma should also consider if claiming deductions under the old regime would further reduce her tax liability below this calculated amount.

How to Use This Income Tax Calculator AY 2025-26

Using the income tax calculator AY 2025-26 is straightforward. Follow these simple steps:

  1. Enter Total Taxable Income: Input your total income after considering all eligible deductions and exemptions for the Financial Year 2024-25. This is the amount on which tax will be calculated.
  2. Select Residency Status: Choose whether you are a 'Resident Individual' or a 'Non-Resident Individual'. This affects taxability.
  3. Specify Age: Select your age group (Below 60, 60-80, or Above 80). Age influences the basic exemption limits, especially under the old tax regime.
  4. Choose Tax Regime: Select either the 'Old Tax Regime' or the 'New Tax Regime'. The new regime is the default and often simpler, while the old regime may be beneficial if you have significant deductions.
  5. Calculate Tax: Click the 'Calculate Tax' button.

How to read results: The calculator will display:

  • Main Result (Highlighted): Your estimated total income tax payable for AY 2025-26.
  • Intermediate Values: Breakdown including Taxable Income, Basic Tax Payable, Surcharge (if applicable), and Health & Education Cess.
  • Formula Explanation: A brief description of how the tax was computed.

Decision-making guidance: Use the results to understand your tax obligation. Compare the tax payable under both regimes if you are unsure which is better. Remember, the calculator provides an estimate; consult a tax professional for personalized advice, especially if you have complex financial situations or plan to claim numerous deductions.

Key Factors That Affect Income Tax Calculator AY 2025-26 Results

Several factors significantly influence the outcome of an income tax calculator AY 2025-26. Understanding these can help you provide accurate inputs and interpret the results correctly:

  1. Total Taxable Income: This is the most crucial input. It's not your gross income but your income after deducting all permissible expenses, exemptions (like HRA, LTA), and deductions (under Chapter VI-A like 80C, 80D, etc.). Accuracy here is paramount.
  2. Choice of Tax Regime: The old and new tax regimes have different tax slabs and rules. The new regime is simpler with fewer exemptions but may result in higher tax for those with substantial deductions. The old regime allows for various deductions but has different slab rates.
  3. Age of the Individual: For the old tax regime, age determines the basic exemption limit (₹2.5 Lakhs for 80). This significantly impacts the tax calculation.
  4. Residency Status: Tax rules differ for resident and non-resident individuals. While this calculator primarily focuses on residents, non-residents have specific tax implications.
  5. Applicable Deductions and Exemptions: While this calculator takes 'Total Taxable Income' as input, the actual amount of deductions and exemptions claimed drastically affects this figure. For instance, investments in PPF, ELSS, life insurance premiums, home loan interest, etc., can reduce taxable income, especially under the old regime.
  6. Surcharge Applicability: For very high net worth individuals, surcharge rates increase progressively based on income levels (e.g., above ₹50 Lakhs, ₹1 Crore, ₹2 Crores, ₹5 Crores). This calculator might simplify surcharge calculation for typical individual incomes.
  7. Capital Gains: Income from selling assets like shares or property is taxed differently based on the holding period (short-term vs. long-term) and asset type. This calculator assumes such income is already factored into the 'Total Taxable Income'.
  8. Inflation and Cost of Living: While not directly calculated, inflation impacts the real value of income and deductions over time. Tax policies are often adjusted considering inflation, affecting future tax calculations.

Frequently Asked Questions (FAQ)

Q1: What is the difference between Financial Year (FY) and Assessment Year (AY)?

The Financial Year (FY) is the period during which income is earned (e.g., April 1, 2024, to March 31, 2025). The Assessment Year (AY) is the year immediately following the FY, during which the income earned in the previous FY is assessed and taxed (e.g., AY 2025-26 for FY 2024-25).

Q2: Is the New Tax Regime mandatory for AY 2025-26?

No, the New Tax Regime is the default option, but individuals can still choose to opt for the Old Tax Regime if it is more beneficial for them, provided they meet the conditions for claiming deductions and exemptions under the old regime.

Q3: Does this calculator include the rebate under Section 87A?

This calculator focuses on the core tax calculation based on slabs, surcharge, and cess. For simplicity, it does not explicitly calculate the rebate under Section 87A, which reduces tax liability for individuals with taxable income up to ₹7 Lakhs (New Regime) or ₹5 Lakhs (Old Regime, if applicable). The actual tax payable might be lower if you qualify for this rebate.

Q4: What if my income is below ₹3 Lakhs?

Under the New Tax Regime, income up to ₹3 Lakhs is taxed at 0%. Under the Old Tax Regime, income up to ₹2.5 Lakhs is tax-free for individuals below 60. For senior citizens (60-80), the limit is ₹3 Lakhs. The calculator will reflect this zero tax liability.

Q5: How are capital gains taxed?

Capital gains are taxed based on the type of asset and holding period. Short-term capital gains are typically taxed at slab rates, while long-term capital gains on certain assets like property or equity shares have specific rates (e.g., 20% with indexation for long-term, 15% for short-term equity gains). This calculator assumes capital gains are already included in the 'Total Taxable Income' figure.

Q6: Can I use this calculator for HUF or companies?

No, this calculator is specifically designed for individual taxpayers. Hindu Undivided Families (HUFs) and companies have different tax structures, slabs, and regulations.

Q7: What is the surcharge rate for AY 2025-26?

For individuals, surcharge rates typically start at 10% if total income exceeds ₹50 Lakhs, increasing to 15%, 25%, and 37% at higher income thresholds. However, for AY 2025-26, the highest surcharge rate for individuals opting for the New Tax Regime has been capped at 25% for incomes above ₹2 crore. For the Old Regime, the 37% surcharge rate applies for incomes above ₹5 crore. This calculator may simplify this based on common income levels.

Q8: How do I find my 'Total Taxable Income'?

'Total Taxable Income' is your Gross Total Income (sum of income from all sources like salary, house property, business, capital gains, other sources) minus all eligible deductions under Chapter VI-A (like 80C, 80D, 80G, etc.) and specific exemptions (like HRA, LTA, standard deduction for salary income). If you are unsure, consult your salary slip, Form 16, or a tax advisor.

Disclaimer: This calculator provides an estimate for income tax calculation purposes only. It is based on the tax laws applicable for AY 2025-26 (FY 2024-25) and assumes standard conditions. Consult a qualified tax professional for personalized advice and accurate tax filing.

var taxableIncomeInput = document.getElementById('taxableIncome'); var residencyStatusSelect = document.getElementById('residencyStatus'); var ageSelect = document.getElementById('age'); var regimeSelect = document.getElementById('regime'); var resultTaxableIncomeSpan = document.getElementById('resultTaxableIncome'); var resultBasicTaxSpan = document.getElementById('resultBasicTax'); var resultSurchargeSpan = document.getElementById('resultSurcharge'); var resultCessSpan = document.getElementById('resultCess'); var mainResultDiv = document.getElementById('mainResult'); var taxableIncomeError = document.getElementById('taxableIncomeError'); var residencyStatusError = document.getElementById('residencyStatusError'); var ageError = document.getElementById('ageError'); var regimeError = document.getElementById('regimeError'); var chart; var chartCtx; function formatCurrency(amount) { return '₹' + amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); } function calculateTax() { var income = parseFloat(taxableIncomeInput.value); var residency = residencyStatusSelect.value; var age = ageSelect.value; var regime = regimeSelect.value; var errors = false; // Input validation if (isNaN(income) || income < 0) { taxableIncomeError.textContent = 'Please enter a valid positive number for income.'; taxableIncomeError.classList.add('visible'); errors = true; } else { taxableIncomeError.textContent = ''; taxableIncomeError.classList.remove('visible'); } // Basic defaults and calculations var basicTax = 0; var surcharge = 0; var cess = 0; var totalTax = 0; var taxableIncomeForDisplay = income; // Use the input value for display if (!errors) { if (regime === 'new') { // New Tax Regime Slabs AY 2025-26 if (income <= 300000) { basicTax = 0; } else if (income <= 600000) { basicTax = (income – 300000) * 0.05; } else if (income <= 900000) { basicTax = (300000 * 0.05) + (income – 600000) * 0.10; } else if (income <= 1200000) { basicTax = (300000 * 0.05) + (300000 * 0.10) + (income – 900000) * 0.15; } else if (income <= 1500000) { basicTax = (300000 * 0.05) + (300000 * 0.10) + (300000 * 0.15) + (income – 1200000) * 0.20; } else { basicTax = (300000 * 0.05) + (300000 * 0.10) + (300000 * 0.15) + (300000 * 0.20) + (income – 1500000) * 0.30; } } else { // Old Tax Regime var exemptionLimit = 250000; if (age === '60to80') { exemptionLimit = 300000; } else if (age === 'above80') { exemptionLimit = 500000; } if (income <= exemptionLimit) { basicTax = 0; } else if (income <= 500000) { basicTax = (income – exemptionLimit) * 0.05; } else if (income 2 Cr. // For old regime, 37% if income > 5 Cr. // We'll apply a simplified surcharge for incomes above 50 Lakhs for demonstration. if (income > 5000000) { if (regime === 'new') { if (income > 20000000) surcharge = basicTax * 0.25; // Capped at 25% for new regime > 2 Cr else surcharge = basicTax * 0.10; // 10% for income 50L to 2 Cr } else { // Old Regime if (income > 50000000) surcharge = basicTax * 0.37; // 37% for income > 5 Cr else if (income > 10000000) surcharge = basicTax * 0.25; // 25% for income 1 Cr to 5 Cr else surcharge = basicTax * 0.15; // 15% for income 50L to 1 Cr } } cess = (basicTax + surcharge) * 0.04; totalTax = basicTax + surcharge + cess; // Rebate under Section 87A is not explicitly calculated here for simplicity, // but it would reduce totalTax to 0 if income <= 7L (New) or 5L (Old, if applicable). // For this calculator, we show the tax before rebate. } // Update results display resultTaxableIncomeSpan.textContent = formatCurrency(taxableIncomeForDisplay); resultBasicTaxSpan.textContent = formatCurrency(basicTax); resultSurchargeSpan.textContent = formatCurrency(surcharge); resultCessSpan.textContent = formatCurrency(cess); mainResultDiv.innerHTML = formatCurrency(totalTax) + 'Estimated Income Tax Payable'; // Update chart data updateChart(basicTax, surcharge, cess); } function updateChart(basicTax, surcharge, cess) { var ctx = document.getElementById('taxChart').getContext('2d'); if (chart) { chart.destroy(); } chart = new Chart(ctx, { type: 'bar', data: { labels: ['Tax Components'], datasets: [{ label: 'Basic Tax', data: [basicTax], backgroundColor: 'rgba(0, 74, 153, 0.7)', // Primary color borderColor: 'rgba(0, 74, 153, 1)', borderWidth: 1 }, { label: 'Surcharge', data: [surcharge], backgroundColor: 'rgba(255, 193, 7, 0.7)', // Warning color borderColor: 'rgba(255, 193, 7, 1)', borderWidth: 1 }, { label: 'Cess', data: [cess], backgroundColor: 'rgba(40, 167, 69, 0.7)', // Success color borderColor: 'rgba(40, 167, 69, 1)', borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return formatCurrency(value); } } } }, plugins: { legend: { display: false // Legend is handled by custom div }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += formatCurrency(context.parsed.y); } return label; } } } } } }); } function resetCalculator() { taxableIncomeInput.value = '1000000'; residencyStatusSelect.value = 'resident'; ageSelect.value = 'below60'; regimeSelect.value = 'new'; taxableIncomeError.textContent = "; taxableIncomeError.classList.remove('visible'); calculateTax(); // Recalculate with default values } function copyResults() { var resultsText = "Income Tax Calculation Summary (AY 2025-26):\n\n"; resultsText += "Taxable Income: " + resultTaxableIncomeSpan.textContent + "\n"; resultsText += "Basic Tax Payable: " + resultBasicTaxSpan.textContent + "\n"; resultsText += "Surcharge: " + resultSurchargeSpan.textContent + "\n"; resultsText += "Health & Education Cess (4%): " + resultCessSpan.textContent + "\n"; resultsText += "————————————\n"; resultsText += "Total Tax Payable: " + mainResultDiv.firstChild.textContent + "\n\n"; resultsText += "Key Assumptions:\n"; resultsText += "- Residency Status: " + residencyStatusSelect.options[residencyStatusSelect.selectedIndex].text + "\n"; resultsText += "- Age: " + ageSelect.options[ageSelect.selectedIndex].text + "\n"; resultsText += "- Tax Regime: " + regimeSelect.options[regimeSelect.selectedIndex].text + "\n"; resultsText += "- Rebate under Sec 87A not applied.\n"; navigator.clipboard.writeText(resultsText).then(function() { // Optional: Show a confirmation message var tempButton = document.getElementById('copyBtn'); var originalText = tempButton.textContent; tempButton.textContent = 'Copied!'; setTimeout(function() { tempButton.textContent = originalText; }, 1500); }).catch(function(err) { console.error('Failed to copy text: ', err); // Optional: Show an error message }); } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { // Ensure canvas element exists before trying to get context var canvas = document.getElementById('taxChart'); if (canvas) { chartCtx = canvas.getContext('2d'); // Initialize chart with default values (zeros) updateChart(0, 0, 0); } calculateTax(); }); document.getElementById('calculateBtn').onclick = calculateTax; document.getElementById('resetBtn').onclick = resetCalculator; document.getElementById('copyBtn').onclick = copyResults; // Add event listeners for real-time updates taxableIncomeInput.addEventListener('input', calculateTax); residencyStatusSelect.addEventListener('change', calculateTax); ageSelect.addEventListener('change', calculateTax); regimeSelect.addEventListener('change', calculateTax);

Leave a Comment