Show HN: Calculator for US individual income tax, from 1970-present
All the calculations occur directly in the browser, and are powered by a Fortran program that has been converted to WASM using emscripten. This calculator was originally developed in the 1970s [1] by the non-profit National Bureau of Economic Research. NBER has been maintaining this F77 codebase for the last 50 years, and uses it primarily for academic research on tax policy. The Fortran source code itself is over 1MB of text, because it codifies both federal and all 50 states' tax laws for each of the last 62 years.
I first learned about NBER TAXSIM [2] a few months ago via an interesting paper they published "Automatic Tax Filing: Simulating a Pre-Populated Form 1040" [3]. The Fortran code itself is not open-source, but is available on request for research purposes. I reached out to NBER and proposed compiling it to WASM, so it could be run directly in a browser. With relatively little effort I was able to create a js/wasm version [4], thanks in huge part to previous open-source work [5].
This WASM build now powers https://taxsim.app, which is my attempt to create an interactive UI to allow for easier exploration of the US tax code. Specific tax scenarios can also be shared easily, by simply copying the browser URL. The code for this webapp is also open-source [6].
This was my first time experimenting with WASM, and I am already a huge fan. Not only was I able to take a 60 year old codebase and get it working on every modern browser and device, this work is also now benefiting the academic community. For example, the js/wasm can be run directly in V8, which means it can also now be run locally within R using libv8 [7]. Previously most researchers were uploading their tax scenarios to NBER's servers via ftp/ssh/http.
[1] https://taxsim.nber.org/feenberg-coutts.pdf
[3] https://www.nber.org/papers/w30008
[4] https://github.com/tmm1/taxsim.js
[5] https://chrz.de/2020/04/21/fortran-in-the-browser/
159 comments
[ 4.2 ms ] story [ 224 ms ] threadImagine if IRS would produce something like this (open sourced) and we could file our returns like this.
> Each year Americans spend over two billion hours and $30 billion preparing individual tax returns, and these filing costs are regressive. To lower and redistribute the filing burden, some commentators have proposed having the IRS pre-populate tax returns for individuals. We evaluate this hypothetical policy using a large, nationally representative sample of returns filed for the tax year 2019. Our baseline results indicate that between 62 and 73 million returns (41 to 48 percent of all returns) could be accurately pre-populated using only current-year information returns and the prior-year return. Accuracy rates decline with income and are higher for taxpayers who have fewer dependents or are unmarried. We also examine 2019 non-filers, finding that pre- populated returns tentatively indicate $9.0 billion in refunds due to 12 million (22 percent) of them.
[1] https://www.nber.org/system/files/working_papers/w30008/w300...
Order your tax “transcript of account” in late March and again in late August. It’ll be substantially more complete in late August.
This only works because there's a high level of trust in the government and low corruption, and having detailed tracking isn't (very) controversial. The US is almost the exact opposite on every metric so it wouldn't work for it.
Maybe you don't, but a lot of wealthy people who can afford to hire tax professionals do. For example, how certain famous billionaires[0] have received billions of tax free income because they took the position that it could be classified as a certain type of income.
[0]https://www.bloomberg.com/news/articles/2021-06-24/peter-thi...
I do not know if that was intentionally forced on citizens in the USA to do their own taxes (even tho IRS had accurate information from W3s for nearly half of payers) for that purpose, but I think such exposure to the behind scenes calculation of taxes might force citizens to be more aware of what they are paying.
For example, back to my home country - I think income tax is something like 11% or 13% today. And most folks see this tax on their pay stubs. But what they do not see (although some are aware of) - employer pays extra 36% of the salary into social security. In the USA employee sees at least half of it (6.20% of 12.40%). The health insurance premiums are also prominent on the tax return, same with retirement. None of that is visible in any form to employees in my home country.
Only if 100% of your income is reported to the IRS. Small amounts (under $600) often aren't, and while you might be able to get away with not reporting it, its obviously not legal. I had some slightly unusual small sources of income the past couple of years that I had to keep records of, report, and pay taxes on.
Granted, a lot of people arent going to have much more than a W2 and maybe some interest income.
As an aside, I'd love to see US gov research grants start requiring the work product to be made open source.
[1]: https://www.nber.org/about-nber/support-funding
[1] https://pslmodels.org/
[2] https://taxcalc.pslmodels.org/
[3] https://taxcalc.pslmodels.org/about/history.html
[4] https://github.com/PSLmodels/Tax-Calculator/blob/master/taxc...
[5] https://github.com/PSLmodels/Tax-Calculator
https://github.com/PSLmodels/Tax-Calculator/blob/master/taxc...
Looks like the data in there goes back to 2013/2014. I'd love to see older historical policy data.
[0] https://github.com/MLanguage/mlang [1] https://arxiv.org/abs/2011.07966
[1] https://openfisca.org
[2] https://github.com/openfisca/openfisca-france
[3] https://github.com/policyengine/openfisca-uk
[4] https://github.com/policyengine/openfisca-us
(OpenFisca US is part of the Policy Simulation Library, and it's developed by a number of former Tax-Calculator developers, myself included.)
[1] https://policyengine.org
[2] https://openfisca.org
[3] https://github.com/policyengine/openfisca-us
[4] https://policyengine.org/us
Nearly every year I don't feel confident that I've filled out my taxes accurately, and it's not for lack of trying.
I assume there were also some campaign contributions that changed hands.
“TAXSIM: Unbelievable spouse age”
Apparently it's not believable that people 115 years or older would be filing taxes.
In fact, it is more popular than ever: the temporary TCJA tax changes (2018-2025) for individuals mostly consisted of moving features of AMT into the regular tax regime. No personal exemptions, large standard deduction, no mortgage interest deduction for equity debt, limited state and local tax (SALT) deduction, mostly no miscellaneous itemized deductions, flatter tax brackets, etc.
Wait, what? When did that happen?
And did the "for equity debt" mean that it still applies to houses?
Since 1987, whenever you originate or re-finance any mortgage, the portion of the proceeds used to buy, build, or improve your personal residence is called "acquisition debt" (used to acquire the asset), and the remaining portion is called "equity debt" since it is secured solely by the pre-existing equity in the property and is used for anything other than acquisition.
When you re-finance acquisition debt, it remains acqusition debt, but any cash-out from the re-finance not used to buy/build/improve is equity debt. As you pay down principal on the loan, you are considered to first pay off the equity debt, before acquisition debt.
That is a very clear explanation. It seems like that got caught up in the whole "no interest other than acquisition debt is deductible" rule change.
Also, I know you were enumerating items, not advocating for their return. I see the change as good, and didn't know if there is a countervailing point of view explaining why interest on equity debt should be deductible (possibly from the entity that educated you on the matter).
Feature request: Put the effective overall tax rate calculation somewhere on the page - so often people are confused that they are paying the same percentage tax as their highest marginal tax rate, this tool could help elucidate that mistake.
For example, I inputted married, with no dependents with $500,000 salary and in 1977, the federal amount was $299,864 and in 2020 was $133,947. I assume these amounts can be compared without further adjusting for inflation?
Tangentially, did federal taxes really come down that much?
https://taxfoundation.org/historical-income-tax-rates-bracke...
Politically, this setup seems to help keep those high-earners voting for lower taxes, which makes sense to them since they're the ones paying the highest overall rate.
And many of the tax “loopholes” involved real estate investment which would be accessible at that income level.
100K in 1980 was sufficient to build and compound your wealth. That’s wealthy.
You should realize that multiple things can be wealthy.
$380k is wealthy and $20M is also wealthy. $20M is wealthier than $380k.
Im the US, an income of $380k is the 99th percentile.
In a higher COL state of California, an income of $380k is still in the 99th percentile.
And for the very high COL city of San Francisco, an income of $380k is still just about the 99th percentile
If a person is making $380k, regardless of what they may believe, they are absolutely not middle class in any way shape or form. They are "wealthy".
Wealthy means to have wealth. Wealth is the abundance of financial assets. Income can become wealth if saved/invested, but it is not wealth.
There are numerous definitions of middle class, with many being "not upper, not lower". Upper class is defined as those that have the most wealth (explicitly not income) and political power.
$People with 380k of income, but without significant assets are not upper class. They would be considered upper middle class.
https://www.merriam-webster.com/dictionary/wealthy
https://en.wikipedia.org/wiki/Wealth
https://en.wikipedia.org/wiki/Middle_class
https://en.wikipedia.org/wiki/Upper_class
I mean sure, but anyone able to sustain that income level will quickly become wealthy unless they have ridiculously high spending levels.
My previous comment seemed to have touched a nerve with some people, which strange given that I (IMO) was politely providing commonly accepted definitions of words/terms, with supporting references. I guess people do not like the actual meanings of the words. Or perhaps I sounded like an condescending asshole :shrug:
obscenely rich
That’s wealthy to me.
This is such a compelling narrative for the "taxes should be lower" crowd that I'm skeptical. Granted, this is my personal bias. But I would love to see the actual clear examples of how people are deducting like 50% of their income or whatever they'd need to bring their 70% marginal rate down to 35%.
There was a major overhaul of the tax code in the 1980s that simultaneously eliminated many of the tax deductions and offset that loss of deductions with lower the marginal tax rates. The change was approximately revenue neutral but made the tax code simpler.
Are you arguing that the tax revenue grew too quickly to be defined as "revenue neutral"?
I'm not old enough to have experienced it but the data is really obvious.
Income and income taxes are irrelevant to the wealthy. Changes in wealth inequality are mostly changes in asset prices.
Yes, that is the econometric definition of revenue neutral tax changes. Of course most any change in tax structures will affect individuals, but that is nearly irrelevant (unless you never want a change to tax law).
> while wealthy people saw their rate drop dramatically
Have you looked up this claim with actual historical effective tax rate numbers? It's simply not true.
Here's [1] CBO total effective tax rates across many income level, from 1979 to 2005. Look at Table 1, then Total Effective Rate (which is what each group actually paid). Take, for example, Reagan tax cut of 1986, and pick a window around it, saw 1984 to 1987. Top 0.01 effective rate increased from 31.8 to 33.9. Lowest quintile rate decreased from 10.2 to 8.7.
In fact, for the 1986 cut, the lowest 4 quintiles saw a slight tax decrease, the top quintile saw a tax increase.
Next, look through the individual income tax rates - again, the same. After the Reagan tax cut in 1986, the top 0.01% saw an increase in effective rates - higher than any from 1979 (start of the dataset) through 87.
Here too you see the bottom 80% ending up with lower tax rates across the board.
I don't know where you got the idea rates dropped dramatically. It's not in this data.
[1] https://www.cbo.gov/sites/default/files/110th-congress-2007-...
Maybe instead of your claiming "wealthy people saw their rate drop dramatically" you should more accurately claim "I heard one wealthy person claim their rate dropped, but I didn't actually inspect their taxes... The majority didn't see this mythical drop. Most saw the opposite." That is the claim you've provided evidence for.
If your world view is formed from choosing one off examples over well-sourced, broad based evidence, it's not surprising you believe things that are simply untrue.
> Maybe you need to take a walk.....
Maybe you need to learn what terms mean and how evidence works to before making wild claims. Anecdotes are irrelvant compared to population when making population claims for good reason.
If the subway costs $1 and 50% of the jump the turn-style 50% of the time the cost to ride the subway in aggregate is $0.75
Sure, if you take some asinine ideological hard line about the goodness or badness of taxation you'll probably get your panties in a knot but if you look at it from the perspective of who's spending money in the economy a little bit of broadly applied fraud and a little bit of tax reduction are the same thing because they shuffle money around in the same manner.
Sometimes called “principled”
No, you have jumpers whose aggregate cost is $0.50 and non-jumpers whose aggregate cost is $1.00. The revenues realized are $0.75 a ride, but the costs aren't distributed evenly. If the jumpers were caught, then the cost could decline to $0.75, the nonjumpers would pay less and the jumpers would pay more. That world is better for the half of the population that doesn't jump.
back then you could file your taxes with 6 or 7 kids and no one would check
that is not the same as claiming you have 6 or 7 kids that will be filed on your taxes and then just never filing it. Once filed he would need SSN for those kids, or he would owe taxes
One of the biggest was that there was an investment tax credit of 7% in the 60's and 10% in the 70's, which I believe was uncapped. I think those were also able to be rolled over to cover multiple years. That means that if you invested enough, you could pay essentially no taxes. This was repealed in 1986.
[edit] Another that I should probably mention is the treatment of asset depreciation; in the 1960's and 70's the government was incredibly generous with regards to asset depreciation. For example, they allowed more rapid depreciation so you can have assets fully depreciated while still within their useful life and potentially if you sold those would pay capital gains tax on them, meaning you reaped significant tax savings over the asset's lifetime.
That is pretty much how it is today as well. 100% bonus depreciation, Sec. 179, and the safe harbor for writing off pretty much any item under $2,500 as an expense, are all in place currently, and the favorable treatment of subsequent gain from sale is still there too.
the other thing people don't mention is that companies got around higher tax rates by giving benefits like company cars and other things to entice employees when giving a higher salary would be stupid due to high tax rates. This is how things like health insurance ended up getting tied to employment, always unintended consequences
Same result. different cause (in this case)
Our wealth inequality problems could largely be solved by fixing the tax brackets (especially w.r.t. capital gains). We don't need all sorts of new taxes, certainly not a wealth tax, before fixing the obvious problem.
That being said, $500,000 should have been taxed more heavily in 1977 relative to today in a perfect world, because that amount of money was worth a lot more back then. I don't think the numbers are inflation adjusted or it would make sense to do so without a big warning.
I think one issue with calculators like this is it doesn’t account for excluding revenue that now has to be included.
https://en.m.wikipedia.org/wiki/Tax_Reform_Act_of_1986
Tax straddles were only banned in 1977 before that you should have easily been able to more then halve your tax bill with futures.
Looking for Tax Losses in Commodities (1977) https://www.nytimes.com/1977/12/11/archives/investing-lookin...
I.R.S. Wins On Tax Straddles (1982) https://www.nytimes.com/1982/03/10/business/irs-wins-on-tax-...
They are wildly popular in the options (including futures options) market, but what is described here would be called a calender spread or an unbalanced strangle of some sort. No tax benefits from closing long dated contracts early aside from losses offsetting the gains
> For example, an investor with a capital gain manipulates investments to create an artificial loss from an unrelated transaction to offset their gain in a current year, and postpone the gain till the following tax year.
There are “only” 5 possible inputs under Deductions & Credits but 3 of them are categories with several subitems:
Itemized Deductions
• Home mortgage interest
• Deductible medical expenses
• Motor Vehicle registration fees
• Charitable contributions
• Casulty or Theft losses
Other Itemized Deductions
• Other state and local taxes
• Deductible medical expenses (preference share only)
• Miscellaneous expenses
Other Adjustments
• Alimony Paid
• Keogh and IRA contributions
• Foreign Income Exclusion
• Net Operating Losses
I found an article about it here: https://taxfoundation.org/standard-deduction-itemized-deduct...
There are some schemes through employers that reduce your taxable income (for e.g. a scheme to purchase a bicycle tax free) but these are handled by your employer and work by sacrificing some salary in exchange for the benefits.
This results in perverse pressures to make the Federal processes that people are exposed to, such as tax filing, as bad as possible so that voters also hate the Federal government.
It would also be great to provide a line graph that shows the result for all years. There’s no reason to have to select each year one-by-one.
[1] https://www.thebalance.com/cities-that-levy-income-taxes-319... [2] https://smartasset.com/taxes/income-taxes
Anyway taxsim is obviously the more complete tool, but without local income taxes it's unusable for many people like me who live in a state that has local income taxes too.
The adjustment process seems to be opaque[1] but perhaps you could use a regression to estimate it. Then you would only need the ability to make those adjustments in this program to run future year scenarios.
1: https://www.irs.gov/newsroom/irs-provides-tax-inflation-adju... (I’m uncertain whether this is based on some predetermined formula)
You can't even always estimate current year taxes, since Congress has lately taken to making retroactive changes to the tax code even after the end of the tax year (just extending their long-term habit of making changes in late December of the current year).
That said, in tech Americans seem to make 50%-100% more total comp on a cost of living adjusted basis doing exactly the same job...
That's a generalisation, although some conservatives do make the claim. It's nonsense, of course: the most other developed countries including the UK spend around a third as much per person on healthcare. Another victim of poorly regulated market consolidation (among other factors).
I'd love to get in touch. Will email you from max@policyengine.org.
[1] https://github.com/policyengine/openfisca-us
[2] https://policyengine.org/us
Currently, many Federal tax forms are supported, as well as tax filing for the state of Illinois. Filing for Oregon and California is under development!
1. A plot over time
2. Could you adjust the income for inflation, so when you click back 1yr your income goes down accordingly?
I think it gives a general idea of the tax situation, but possibly decreasing accuracy at high incomes, where a tax strategy can be implemented specific to the special deductions/credits each year, which are difficult to include in this form.
I had excellent results with f2c on an old Fortran program when I used it.
This will be much simpler/easier than gfortran+dragonegg, and removes some roadblocks preventing me from using the latest emscripten/llvm.