Income Tax Calculator API
The Income Tax Calculator API provides detailed tax calculations for the United States and Canada. Annual tax calculation supports federal, state/provincial, and FICA. Per-paycheck calculation uses IRS Publication 15-T W-4 worksheets and supports both the 2020-or-later and pre-2020 W-4 forms.
Available endpoints:
- /v1/incometaxcalculator - Calculate annual income taxes by income and location
- /v1/paycheckwithholding - Calculate per-paycheck federal/state/FICA withholding from W-4 inputs
Only interested in getting current and historical income tax rates? Check out our Income Tax API.
From 2,366 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 318ms | 331ms | 363ms | 712ms | 1196ms |
Didn't find what you were looking for? Suggest an improvement
/v1/incometaxcalculator GET
https://api.api-ninjas.com/v1/incometaxcalculator
Returns comprehensive annual tax calculations including federal, state/provincial, and FICA taxes where applicable.
Parameters
countryrequired2-letter country code (e.g., US, CA)
regionrequiredState/province code (e.g., CA, NY, ON)
incomerequiredAnnual income amount
tax_yearoptionalTax year in YYYY format (e.g.,
2026). If not specified, the latest year will be used.filing_statusrequired for USTax filing status. Possible values:
single,married(married filing jointly),married_separate(married filing separately), orhead_of_householddeductionsoptionalTotal tax deductions amount
creditsoptionalTotal tax credits amount
self_employedoptionalSet to true for self-employed tax calculations (US only)
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
countryThe country code used in the calculation.
regionThe state/province code used in the calculation.
incomeThe annual income amount.
taxable_incomeIncome after deductions.
deductionsTotal deductions applied.
creditsTotal tax credits applied.
federal_effective_rateEffective federal tax rate as a decimal.
federal_taxes_owedTotal federal taxes owed.
fica_social_securitypremium onlySocial Security tax amount - US only.
fica_social_security_ratepremium onlySocial Security tax rate as a decimal - US only.
fica_social_security_cappremium onlySocial Security wage base cap - US only.
fica_medicarepremium onlyMedicare tax amount - US only.
fica_medicare_ratepremium onlyMedicare tax rate as a decimal - US only.
fica_totalpremium onlyTotal FICA taxes (Social Security + Medicare taxes) - US only.
region_effective_ratepremium onlyEffective state/provincial tax rate as a decimal.
region_taxes_owedpremium onlyTotal state/provincial taxes owed.
total_taxes_owedpremium onlyTotal taxes owed (federal + state/provincial + FICA).
income_after_taxpremium onlyIncome remaining after all taxes.
total_effective_tax_ratepremium onlyOverall effective tax rate as a decimal.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/incometaxcalculator?country=US®ion=CA&income=100000&filing_status=single&tax_year=2026Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/incometaxcalculator?country=US®ion=CA&income=100000&filing_status=single&tax_year=2026" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
/v1/paycheckwithholding GET premium only
https://api.api-ninjas.com/v1/paycheckwithholding
Returns per-paycheck federal withholding, FICA (Social Security, Medicare, Additional Medicare), and optional state withholding given gross pay and W-4 inputs. Federal withholding uses IRS Publication 15-T percentage method tables for both the 2020-or-later and pre-2020 W-4 forms.
Parameters
gross_payrequiredGross pay for the period (in dollars).
pay_periodrequiredOne of:
weekly,biweekly,semimonthly,monthly,quarterly,semiannually,annually,daily.filing_statusrequiredOne of:
single,married(married filing jointly),married_separate,head_of_household.stateoptional2-letter US state code. Omit for federal-only calculation.
tax_yearoptionalTax year (YYYY). Defaults to the current year. Currently supported: 2026.
w4_versionoptional2020_or_later(default) orpre_2020. Selects which W-4 worksheet to use.multiple_jobsoptionalW-4 Step 2(c) "multiple jobs" checkbox (2020+ W-4 only).
trueorfalse. Defaultfalse.dependents_amountoptionalW-4 Step 3 total annual credit for dependents (2020+ W-4).
other_incomeoptionalW-4 Step 4(a) annual other income (2020+ W-4).
deductionsoptionalW-4 Step 4(b) annual deductions over the standard deduction (2020+ W-4).
extra_withholdingoptionalW-4 Step 4(c) extra per-period withholding (added directly to federal withholding).
allowancesoptionalPre-2020 W-4 only. Number of allowances claimed on line 5 of the 2019-or-earlier W-4.
pretax_deductionsoptionalPre-tax deductions for this paycheck (401(k), HSA, cafeteria plans). Reduces taxable wages.
ytd_grossoptionalYear-to-date gross wages before this paycheck. Used to apply the Social Security wage base cap and the 0.9% Additional Medicare tax above $200,000 YTD.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
gross_payGross pay for the period (echoed back).
pay_periodPay period (echoed back).
tax_yearTax year used for the calculation.
filing_statusFiling status used.
w4_versionW-4 worksheet version applied.
pretax_deductionsPre-tax deductions used in the calculation.
taxable_wagesGross pay minus pre-tax deductions.
federal_withholdingFederal income tax withheld for this paycheck (including extra withholding).
fica.social_securitySocial Security tax for this paycheck (6.2% up to the annual wage base).
fica.medicareMedicare tax for this paycheck (1.45%).
fica.additional_medicareAdditional Medicare tax for this paycheck (0.9% on YTD wages above $200,000).
fica.totalSum of all FICA components.
state2-letter state code (echoed back) when state was supplied.
state_withholdingState income tax withheld for this paycheck. 0 for no-tax states.
total_withholdingFederal + FICA + state withholding combined.
take_home_payTaxable wages minus total withholding.
annualizedAnnualized projections: gross, federal withholding, and take-home — extrapolating this paycheck across the year.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/paycheckwithholding?gross_pay=5000&pay_period=biweekly&filing_status=single&tax_year=2026Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/paycheckwithholding?gross_pay=5000&pay_period=biweekly&filing_status=single&tax_year=2026" \
-H "X-Api-Key: YOUR_API_KEY"