Federal Income Tax Estimator (Detailed) Formula

Understand the math behind the federal income tax estimator (detailed). Each variable explained with a worked example.

Formulas Used

Taxable Income

taxable_income = taxable

Federal Tax Before Credits

federal_tax = taxable <= 11600 * bracket_adj ? taxable * 0.10 : (taxable <= 47150 * bracket_adj ? 1160 * bracket_adj + (taxable - 11600 * bracket_adj) * 0.12 : (taxable <= 100525 * bracket_adj ? 5426 * bracket_adj + (taxable - 47150 * bracket_adj) * 0.22 : 17168.5 * bracket_adj + (taxable - 100525 * bracket_adj) * 0.24))

Tax After Credits

after_credits = max((taxable <= 11600 * bracket_adj ? taxable * 0.10 : (taxable <= 47150 * bracket_adj ? 1160 * bracket_adj + (taxable - 11600 * bracket_adj) * 0.12 : (taxable <= 100525 * bracket_adj ? 5426 * bracket_adj + (taxable - 47150 * bracket_adj) * 0.22 : 17168.5 * bracket_adj + (taxable - 100525 * bracket_adj) * 0.24))) - tax_credits, 0)

Effective Tax Rate

effective_rate = gross_income > 0 ? max((taxable <= 11600 * bracket_adj ? taxable * 0.10 : (taxable <= 47150 * bracket_adj ? 1160 * bracket_adj + (taxable - 11600 * bracket_adj) * 0.12 : (taxable <= 100525 * bracket_adj ? 5426 * bracket_adj + (taxable - 47150 * bracket_adj) * 0.22 : 17168.5 * bracket_adj + (taxable - 100525 * bracket_adj) * 0.24))) - tax_credits, 0) / gross_income * 100 : 0

Variables

VariableDescriptionDefault
gross_incomeGross Annual Income(USD)90000
filing_statusFiling Status1
deduction_typeDeduction Type14600
other_deductionsAdditional Deductions/Adjustments(USD)0
tax_creditsTax Credits(USD)0
taxableDerived value= max(gross_income - deduction_type - other_deductions, 0)calculated
bracket_adjDerived value= filing_status == 2 ? 2 : 1calculated

How It Works

Federal Tax Estimation (Detailed)

This calculator provides a more comprehensive federal tax estimate by incorporating deductions, adjustments, and credits.

Calculation Steps

1. Start with gross income 2. Subtract deductions (standard or itemized) and adjustments 3. Apply tax brackets to get tax before credits 4. Subtract tax credits (dollar-for-dollar reduction) 5. Result: Tax owed or refund

Deductions vs Credits

  • Deductions reduce taxable income (value = deduction x marginal rate)
  • Credits reduce tax directly (value = full credit amount)
  • Credits are more valuable than deductions of the same amount.

    Worked Example

    $90,000 gross income, single, standard deduction, no additional deductions or credits.

    gross_income = 90000filing_status = 1deduction_type = 14600other_deductions = 0tax_credits = 0
    1. 01Taxable income = $90,000 - $14,600 = $75,400
    2. 0210% on $11,600 = $1,160
    3. 0312% on $35,550 = $4,266
    4. 0422% on $28,250 = $6,215
    5. 05Total tax = $11,641
    6. 06Effective rate = $11,641 / $90,000 = 12.9%