Internet TAXSIM Test Version
Internet TAXSIM
This is an open beta test of Taxsim upated to 2023 state tax laws, and many accuracy improvements. See below for some additional returned values.
Be sure to add yourself to the TAXSIM e-mail list if you use the beta version.
TAXSIM is the NBER's FORTRAN program for calculating liabilities under US Federal and State income tax laws from individual data. Scholars interested in using TAXSIM to calculate tax liabilities and marginal tax rates should follow the these instructions for submitting data. Liabilities are returned as an online web page or directly to a Statistical package in a few seconds. The program itself is also available for local execution.
The federal law and state code is accurate to the best of our abilities through December 2023, including the ACA taxes on earned and unearned income (but not the penalties for lacking health insurance) and the pass-through features of the TCJA (except for the limitations based on capital or employees).
Although most users of Taxsim use the Stata interface, Taxsim is available no matter what computer language you favor, or what firewall constrains you. We understand those constraints and don't want them to discourage users.
Other interfaces
- .wasm Aman Karmani has compiled taxsim into WASM program that executes in your browser. This is still an experiment as of August 2023, the interface is a demonstration of what is possible but this is ideal for confidential data and for users with firewall problems.
- .ado for Stata using NBER server for tax calculation.
- .ado for Stata Executes native code on your local Windows, Linux or OSX computer.
- .R interface by Shane Orr
- Low-level interface for SAS, Python, R, Julia, etc using our server
- Low-level interface with calculations on your local computer
- Julia interface by Johannes.Fleck and a video
- Email interface
- As a library routine callable from C, Fortran, etc (avoiding the binary to ASCII and back conversions).
- Alternatives to Taxsim, for the US and several other countries.
In the list of variables below the Stata and csv names are in bold. Several users have contributed codes for converting common survey files to taxsim format,
Internet TAXSIM test
This is a test version of taxsim. Please be careful.
Calculate liabilities for one taxpayer (fill every box)
OR...Upload a (not too large) file with TAXSIM data:
Instructions for preparing data for TAXSIM.
If you only need a calculation for one taxpayer you can just fill in the blank box beside each of the 35 variables listed above and select "calculate". Don't leave any box blank - use zeroes for none. Also use a zero for item 3 to indicate 'no state tax'. If you leave any blanks, the caclulator will fail silently. Sorry.
Obviously most of these variables will not be available in the typical survey, which will affect the accuracy of the tax calculation but won't disturb the software. Do not include rent tax rebates or state income tax as these will be calculated from other data on this page. A state sales tax deduction will be calculated according to IRS publication 600. Taxsim will determine the optimal itemization decision, including the Taxsim calculation of current state income liability. If you don't want state tax calculations, just set the state id to zero.
This is a simplified list of input variables selected to encompass what might be available in a non-tax oriented survey such as the Survey of Consumer Finance or the Consumer Expenditure Survey. Henry and Day have a comparison of income concepts in several surveys which may be helpful. For labor market surveys such as the CPS, you will have to impute (perhaps just a zero) some deduction items. These items are rich enough to cover the ordinary and supertax brackets, the earned income credit, the child care credit, the partial taxation of Social Security, and UI, the secondary earner deduction, the maximum tax on earned income, the AMT, capital gains preferences, NIIT and other important features of the tax code. At the state level, low income allowances, property and rent credits are calculated if data is available.
If you don't know the wage split between husbands and wives, or if income was QBI or SSTB, you can put it all in one category. This primarily affects FICA and SECA but also child care and secondary earner deductions. The computer won't get the perfect answer, but only you can judge the suitability of the simplification. Obviously ignored in this calculation are some limits, floors and ceilings on some deductions, adjustments, esoteric tax preferences, rental loss limitation, etc. Many of these are available in the full TAXSIM model used internally at the NBER, but have been left out of Internet TAXSIM for the sake of simplicity.
Never put the same income in more than one box. None of the variables explain or modify another box.
Farm income is not listed above - you could put it as wages or property income, or split it up. As wages it will be eligible for the EITC, as property income not. I expect that in an audit the IRS would expect any allocation to have a rational basis, but Taxsim can't do the split for you.
Any income item not mentioned above can be placed wherever you think Taxsim will treat it most correctly for the years you need. Remember that the perfect is the enemy of the good.
A number of states allow optional separate filing for husbands and wives. The tax calculator tries both options and selects the lower tax. If separate filing is chosen non-wage income and deductions are split equally.
Since the federal and state tax liabilities may depend upon each other, the calculations are iterated, with the calculated state tax entered on the federal form as a (potential) deduction and the federal tax similarly placed in the state calculation. (Yes, we know that in law it is only lagged taxes that matter, but that is less interesting for our purposes). A sales tax deduction is available from 2002 on where it exceeds the state income tax. This is taken from regressions based onIRS publication 600. For tax years after 2016, the 2016 coefficients are used (with an allowance for expected inflation). Refundable credits appear as negative liabilities.
If only a single case is uploaded, intermediate calculations are shown for the base case, and after adding a dollar to income. Also, the analytic effect of each of these clawbacks on the marginal rate for the primary earner is itemized. (This calculation doesn't change if you asked for a different marginal rate - it is always the primary earner). If multiple cases are uploaded, the finite difference is only a penny, which is more effective at avoiding notches.
Some users are concerned about imputations. Internet TAXSIM only does only one. Social security taxes on wages and business income are imputed and the result used in the calculation of state income tax for the states that have a deduction for that tax. Anything not listed above becomes a zero on the Form 1040. Zero is always a valid entry, although it may be inaccurate.
Cares act rebates are included in the year they appear on the 1040, not the year the check may have gone out.
The state tax calculators are more comprehensive than the list of variables above would imply.
In the case of the marginal rate on wage income husbands and wives will have different tax rates if the secondary earner deduction is in effect, or if one is above the social security taxable maximum and the other is not.
Sometimes anomalies have arisen from defects in our FORTRAN code, these have been corrected where we have found them or they have been pointed out to us. For more information about TAXSIM besure to expand the headlines below and also see:
Feenberg, Daniel Richard, and Elizabeth Coutts, An Introduction to the TAXSIM Model, Journal of Policy Analysis and Management vol 12 no 1, Winter 1993, pages 189-194.
This paper and this URL (http://taxsim.nber.org/) should be cited if any results from TAXSIM are circulated or published. If you intend to make any serious scholarly (or other) use of Internet TAXSIM you should speak with me about your project on the telephone. I am at 617-863-0343 and can offer advice etc. Don't think I am overwhelmed by calls and won't want to talk with you - I am interested in what people are doing with this tool. Sometimes I can create specialized versions for particular projects.
File Uploads
If you have many cases and are not using a statistical package, you can prepare a csv file in your spreadsheet software, with each line representing a tax return. Taxsim will return a web page with tax liability, etc. for all cases within a few seconds. Accessed via http, Taxsim seems limited to about 2,000 records. This is a browser limitation, not something we do. . Larger CSV files, even millions of records, can be submitted by ftp or ssh or processed on directly or from Stata over the Internet or on your local computer.
For file submissions over http, the first line of your file should show the variable names, using the names in bold on this page. They may be in any order. It is an error to include a variable not named above, but not all variables need to be included. Only year and mstat are required. Fields may be separated by commas or spaces. No missing value codes are allowed - missing data can be represented by zeroes (except for the two required fields).
Here is a sample taxsim input file for two married taxpayers with only 100000 in wages or long term capital gains. Remember missing values must be coded as zero but otherwise the format should be compatible with any generator of .csv files.
The file may include any number of data lines. While the format is flexible, and values may be of variable length, each value must be separated from the next by one or more spaces or a single comma. Tabs won't work. A new case always begins on a new line. We cannot read .prn files, or any file that uses commas or dots to mark thousands. Spreadsheet binary files of any kind can not be read. Before uploading your file please check for the following common errors:
- missing value codes (na, dot, -9, etc)
- out of range state id
- asterisks
- value labels anywhere in the input data
- negative ages, wages, dependents or deductions
- invalid year
- commas embedded in values
- tabs between values
- binary files, (.dta, .xls, .doc, etc).
- spouse income on a single return
The tax calculator stops on any conversion error or value out of range and returns a range error with the case ID.
Marginal Rates (finite differences) with respect to: Other Income Wage Income Taxpayer Earnings Spouse Earnings Long Term Gains Other Deductions Dividends Mortgage Interest Don't botherShow detailed intermediate calculations: Off On Labeled
Marginal Rates (finite differences) with respect to:
Other Income
Wage Income
Taxpayer Earnings
Spouse Earnings
Long Term Gains
Other Deductions
Dividends
Mortgage Interest
Don't bother
Show detailed intermediate calculations:
Off
On
Labeled
Output Results
The 9 columns of results returned by default are:
- taxsimid = Case ID
- year = Year
- state = State code
- fiitax = Federal income tax liability including capital gains rates, surtaxes, Maximum Tax, NIIT, AMT, Additional Medicare Tax and refundable and non-refundable credits including CTC, ACTC and EIC etc, but not including self-employment or FICA taxes. The adjustment to AGI for SE FICA is made.
- siitax = State income tax liability, also after all credits.
- fica = FICA (OADSI and HI, sum of employee AND employer including Additional Medicare Tax)
- frate = federal marginal rate
- srate = state marginal rate
- ficar = FICA rate
- tfica = taxpayer liability for FICA.
Marginal rates are with respect to wage income unless another rate is requested. If detailed intermediate results are requested, the following 35 columns of data are added:
- v10 = Federal AGI
- v11 = UI in AGI
- v12 = Social Security in AGI
- v13 = Zero Bracket Amount (zero for itemizers)
- v14 = Personal Exemptions
- v15 = Exemption Phaseout
- v16 = Deduction Phaseout
- v17 = Itemized Deductions in taxable income
- v18 = Federal Taxable Income
- v19 = Tax on Taxable Income (no special capital gains rates)
- v20 = Exemption Surtax
- v21 = General Tax Credit
- v22 = Child Tax Credit (as adjusted includes additional ctc)
- v23 = Additional Child Tax Credit (refundable)
- v24 = Child Care Credit (including additional credit)
- v25 = Earned Income Credit (total federal)
- v26 = Income for the Alternative Minimum Tax
- v27 = AMT Liability after credit for regular tax and other allowed credits.
- v28 = Federal Income Tax Before Credits (includes special treatment of Capital gains, exemption surtax (1988-1996) and 15% rate phaseout (1988-1990) but not AMT)
- v29 = FICA
The next 11 columns are zeroed if no state is specified:
- v30 = State Household Income (imputation for property tax credit)
- v31 = State Rent Expense (imputation for property tax credit)
- v32 = State AGI
- v33 = State Exemption amount
- v34 = State Standard Deduction
- v35 = State Itemized Deductions
- v36 = State Taxable Income
- v37 = State Property Tax Credit
- v38 = State Child Care Credit
- v39 = State EIC
- v40 = State Total Credits
- v41 = State Bracket Rate
More federal results:
- v42 = Earned Self-Employment Income for FICA
- v43 = Medicare Tax on Unearned Income
- v44 = Medicare Tax on Earned Income
- v45 = CARES act Recovery Rebates
More state results:
- staxbc = State tax before credits
- srebate = State income tax rebates (shown only in year paid even if eligibility depends on prior year)
- senergy = State energy/fuel tax credits
- sctc = State child tax credit
- sptcr = Stata property tax credit
- samt = State alternative minimum tax
Still more federal results:
- qbid = Qualified business income deduction
- niit = Medicare Net Investment Income Tax
- addmed = Medicare additional earnings Tax
- cares = cares rebate
- actc = Additional child tax credit
- cdate = date this version of Taxsim was compiled
Marginal Tax Rates
In law, the deduction for state tax on the federal return or federal tax on the state return is based on amount paid, not liability. In Taxsim, the deduction is for liability, raising an issue of simultaneity which is resolved by iteration. For example, assuming the taxpayer is an itemizer on both returns, and that they are in a state that allows a deduction for federal tax, then an increase in the wage of a dollar, and that the federal bracket rate is .1 and the state rate is .05, then an additional dollar of wage increases the federal tax by 10 cents in the first round. Then the state tax is calculated and it goes up by .05*.9 = .045. That is a deduction from the federal tax, and so the second round starts with federal income up by only .965, not a full dollar. And so on for 3 rounds.
There are many notches in the tax law. While most are small, they generate implausible marginal tax rates that are probably not well suited for analytical use. TAXSIM uses four strategies to reduce the number of notches affecting marginal rate calculations.
- Since most notches occur at integer dollar boundaries, we add .1 cent to wages and other property income for every taxpayer.
- Where step functions are used in the law, we do a
linear interpolation along the steps. You can turn most
of this off with a tax law modification
parameter.
- The TAXSIM calculation of marginal rates is based on a very small finite difference (1 cent) to minimize the chance of encountering a discontinuity in the tax function, and to make such a discontinuity very obvious if it occurs. For example, a discontinuous dollar jump in tax liability would result in a 10,000 percent tax rate, and be immediately noticable.
- If the tax rate is larger in absolute value than 100% (federal) or 25% (state) the finite difference is taken again, but subtracted rather than added. Any remaining unusual marginal rates should be called to our attention.
These effective marginal rates are important to us, because one of the most important uses TAXSIM can be put to is calculating correct after-tax prices in models of economic behavior. A problem has been the presence of decreasing marginal tax rates (notches) and otherwise implausible marginal rates in these calculations. We maintain a list of significant notches that we have noticed. Although notches generally involved very small sums of money, they could have disproportionate effects on the results of a linear regression, which is sensitive to the squared difference of any observation from the mean.
All calculations are done in double precision, so the small finite difference should not reduce accuracy. The alternative strategy of taking a large difference to dilute the notch was not a success when tried.
Nevertheless, most problems arise from actual notches in the tax laws. For example, in the federal law the child care credit is an integer percent of child care expenses, depending on AGI. In this case we have used a smooth interpolation between adjacent percentages even though the tax code prescribes a step function. For the intended purpose of TAXSIM, a little smoothing is a good thing. Especially at the state level some credits are just a fixed amount for taxpayers with income less than X. In that case the range for an smoothing isn't obvious and we have not done any.
Sophisticated users may observe that since notches are part of the law, our strategems bias the results towards lower marginal rates. This is true, but we judge the reduction in variance to be worthwhile.
We are very interested in other solutions to this problem, and suggestions are welcome.
Bug Reporting
If you suspect any case has been calculated incorrectly, please extract that case (or a exemplar, if there are many cases) and run it in individual taxpayer mode above. Examine the output to see if it suggests why the result is a surprise, but if you are still of the opinion that TAXSIM got it wrong, please set the case ID (variable 1) to "-1" and email the output web page to me (as an ascii attachment) with a statement of what you think is wrong. In Stata also set variable idtl to "5". I will get back to you within a day (or two at worst) with an explanation or a fix. It is important that you not send large files. Just send an email with one or two cases, the TAXSIM response and the reason you believe the response to be in error.
We do answer all mail, and we do follow up on queries, but it is important to abide by the guidelines in the previous paragraph. An email message with the statement that "TAXSIM is broken" (unless you are getting no result at all), or even "state x is broken for feature y" will be returned with a request for an example in Internet TAXSIM format as described above. Comments about aggregates not matching public totals are not useful - you need to send an example of a specific return that is off. Once we get that, we will compare our results with hand generated results done from a tax form and any problem will soon be resolved. Comments from users have led to significant improvements in the program, and are almost always resolved within 48 hours. You may wish to try your example in another online calculator - I have a list online
Taxsim has a few competitors that you may wish to try.Confidentiality
For Stata users Taxsimlocal does all the computation on your own computer, and taxsim.wasm does all the computation in your browser. These are perhaps better solutions for users with confidential data.
Random Notes
- Married folk do not usually file separate returns in the US. There is a tax penalty compared to joint filing in most cases. Single folk do not have income or age for a spouse. This is problematic in survey data, since the marital status information is typically current, but the income information is from the prior year. The solution is to either change the marital status to married (so the return status becomes joint) or convert the record to two individual returns. Otherwise taxsim will fail at the first such record, and subsequent records will have only missing tax data.
- Negative taxes and negative marginal rates are due to refundable tax credits, such as the Earned Income Credit (EIC) and the Additional Chlld Tax Credit.
- The FICA estimate includes both employee and employer tax. Half of FICA is paid by the employer, so the variable TFICA is supplied with the employee share.
- The CARES act recovery rebates use 2020 income in the calculation of the 2020 clawback.
Daniel Feenberg
NBER
1050 Mass Ave.
Cambridge MA 02138
617-588-0343
feenberg@nber.org
Date last modified: August 23, 2024 Taxsim home page