NewConnect Claude, Cursor, ChatGPT, and other AI agents to API Ninjas via our MCP server

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:

Only interested in getting current and historical income tax rates? Check out our Income Tax API.

(4.5)

From 2,366 users

1,000+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
318ms331ms363ms712ms1196ms

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

  • country  required

    2-letter country code (e.g., US, CA)

  • region  required

    State/province code (e.g., CA, NY, ON)

  • income  required

    Annual income amount

  • tax_year  optional

    Tax year in YYYY format (e.g., 2026). If not specified, the latest year will be used.

  • filing_status  required for US

    Tax filing status. Possible values: single, married (married filing jointly), married_separate (married filing separately), or head_of_household

  • deductions  optional

    Total tax deductions amount

  • credits  optional

    Total tax credits amount

  • self_employed  optional

    Set to true for self-employed tax calculations (US only)

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • country

    The country code used in the calculation.

  • region

    The state/province code used in the calculation.

  • income

    The annual income amount.

  • taxable_income

    Income after deductions.

  • deductions

    Total deductions applied.

  • credits

    Total tax credits applied.

  • federal_effective_rate

    Effective federal tax rate as a decimal.

  • federal_taxes_owed

    Total federal taxes owed.

  • fica_social_security premium only

    Social Security tax amount - US only.

  • fica_social_security_rate premium only

    Social Security tax rate as a decimal - US only.

  • fica_social_security_cap premium only

    Social Security wage base cap - US only.

  • fica_medicare premium only

    Medicare tax amount - US only.

  • fica_medicare_rate premium only

    Medicare tax rate as a decimal - US only.

  • fica_total premium only

    Total FICA taxes (Social Security + Medicare taxes) - US only.

  • region_effective_rate premium only

    Effective state/provincial tax rate as a decimal.

  • region_taxes_owed premium only

    Total state/provincial taxes owed.

  • total_taxes_owed premium only

    Total taxes owed (federal + state/provincial + FICA).

  • income_after_tax premium only

    Income remaining after all taxes.

  • total_effective_tax_rate premium only

    Overall effective tax rate as a decimal.

Sample Request Live Demo!

country
region
income
tax_year
filing_status

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/incometaxcalculator?country=US&region=CA&income=100000&filing_status=single&tax_year=2026

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/incometaxcalculator?country=US&region=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_pay  required

    Gross pay for the period (in dollars).

  • pay_period  required

    One of: weekly, biweekly, semimonthly, monthly, quarterly, semiannually, annually, daily.

  • filing_status  required

    One of: single, married (married filing jointly), married_separate, head_of_household.

  • state  optional

    2-letter US state code. Omit for federal-only calculation.

  • tax_year  optional

    Tax year (YYYY). Defaults to the current year. Currently supported: 2026.

  • w4_version  optional

    2020_or_later (default) or pre_2020. Selects which W-4 worksheet to use.

  • multiple_jobs  optional

    W-4 Step 2(c) "multiple jobs" checkbox (2020+ W-4 only). true or false. Default false.

  • dependents_amount  optional

    W-4 Step 3 total annual credit for dependents (2020+ W-4).

  • other_income  optional

    W-4 Step 4(a) annual other income (2020+ W-4).

  • deductions  optional

    W-4 Step 4(b) annual deductions over the standard deduction (2020+ W-4).

  • extra_withholding  optional

    W-4 Step 4(c) extra per-period withholding (added directly to federal withholding).

  • allowances  optional

    Pre-2020 W-4 only. Number of allowances claimed on line 5 of the 2019-or-earlier W-4.

  • pretax_deductions  optional

    Pre-tax deductions for this paycheck (401(k), HSA, cafeteria plans). Reduces taxable wages.

  • ytd_gross  optional

    Year-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-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • gross_pay

    Gross pay for the period (echoed back).

  • pay_period

    Pay period (echoed back).

  • tax_year

    Tax year used for the calculation.

  • filing_status

    Filing status used.

  • w4_version

    W-4 worksheet version applied.

  • pretax_deductions

    Pre-tax deductions used in the calculation.

  • taxable_wages

    Gross pay minus pre-tax deductions.

  • federal_withholding

    Federal income tax withheld for this paycheck (including extra withholding).

  • fica.social_security

    Social Security tax for this paycheck (6.2% up to the annual wage base).

  • fica.medicare

    Medicare tax for this paycheck (1.45%).

  • fica.additional_medicare

    Additional Medicare tax for this paycheck (0.9% on YTD wages above $200,000).

  • fica.total

    Sum of all FICA components.

  • state

    2-letter state code (echoed back) when state was supplied.

  • state_withholding

    State income tax withheld for this paycheck. 0 for no-tax states.

  • total_withholding

    Federal + FICA + state withholding combined.

  • take_home_pay

    Taxable wages minus total withholding.

  • annualized

    Annualized projections: gross, federal withholding, and take-home — extrapolating this paycheck across the year.

Sample Request Live Demo!

gross_pay
pay_period
filing_status
state
tax_year

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=2026

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

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"