Skip to content

Compute Federal Income Tax

Starting in 2020, the IRS introduced some major changes to the calculation of federal income tax. When withholding for workers, you must follow different rules depending on whether the employee has signed a Form W-4 from the year 2020 or later.

For those who have not signed the new form, the withholding rules still count exemptions from their existing W-4. Your application should use the ‘FIT’ formula for these employees. For those who have signed a 2020 or later W-4, your application should use the ‘Federal Income Tax’ formula.

These formulas use different fields for tax calculation. Your application’s employee setup should follow the specific Instructions given by each formula.

Examples

Employee with 2018 federal W-4:

// using TaxControls;
try {
CTaxControl tc = new CTaxControl();
tc.DataFilename = "us.dat";
tc.PayPeriodsPerYear = emp.pay_periods;
tc.Earnings = emp.earnings;
tc.FilingStatus = emp.federal_status;
tc.SelectedTax = "FIT";
tc.Exemptions = emp.federal_exemptions;
Console.WriteLine(tc.TaxAmount());
} catch (TaxControlException e) {
Console.WriteLine(e.Message);
}

Employee with 2021 federal W-4:

// using TaxControls;
try {
CTaxControl tc = new CTaxControl();
tc.DataFilename = "us.dat";
tc.PayPeriodsPerYear = emp.pay_periods;
tc.Earnings = emp.earnings;
tc.FilingStatus = emp.federal_status;
// Above is unchanged. Note these 4 changes:
tc.SelectedTax = "Federal Income Tax";
tc.Exemptions = emp.W4_line3;
tc.Auxiliary = emp.W4_step2_checked ? 1 : 0;
tc.Miscellaneous = emp.W4_line4a - emp.W4_line4b;
Console.WriteLine(tc.TaxAmount());
} catch (TaxControlException e) {
Console.WriteLine(e.Message);
}