8 ms·
Show HN: Calculator for US individual income tax, from 1970-present
I wanted to share a simple web app I created recently, which lets you estimate income taxes owed in the US: https://taxsim.app https://taxsim.app
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 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 https://taxsim.nber.org/feenberg-coutts.pdf
[2] https://taxsim.nber.org/ https://taxsim.nber.org/
[3] https://www.nber.org/papers/w30008 https://www.nber.org/papers/w30008
[4] https://github.com/tmm1/taxsim.js https://github.com/tmm1/taxsim.js
[5] https://chrz.de/2020/04/21/fortran-in-the-browser/ https://chrz.de/2020/04/21/fortran-in-the-browser/
[6] https://github.com/tmm1/taxsim.app https://github.com/tmm1/taxsim.app
[7] https://github.com/shanejorr/usincometaxes/pull/11 https://github.com/shanejorr/usincometaxes/pull/11
- CSMastermind 4y agoWould be helpful if there was a way to see a graph of how the amounts change over time. I find myself putting in my info and then click minus on the years to see how the years change.
- moneywoes 4y agoHow do we know how many percent of people paid tax during these times
- alexb_ 4y agoThis is really cool, but I have to say that sliders are the absolute worst way to input income and benefits. Why not just use a simple textbox?
- tmm1 4y agoYou can switch to text boxes via the gear at the top right.
- zeckalpha 4y agoI made tiny typo (an extra digit in spouse age) and got a giant error, though at least it was actionable “TAXSIM: Unbelievable spouse age”
- omoikane 4y agoThis error message is hilarious, so I tried to find where the threshold is. Apparently it's not believable that people 115 years or older would be filing taxes.
- googlryas 4y agoVery cool, especially hearing about the implementation. 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.
- refurb 4y agoDidn’t take a close look but the 1986 (?) tax code update close major tax avoidance pathways (passive loses and tax shelters in wiki link). 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 https://en.m.wikipedia.org/wiki/Tax_Reform_Act_of_1986
- petercooper 4y agoThe US personal tax code looks extremely complicated to British eyes, but British people have a similar calculator at their disposal at https://listentotaxman.com/ https://listentotaxman.com/ though it only goes back to 2000.
- MaxGhenis 4y agoWe've also built an open-source tax and benefit calculator for the UK, which also lets you simulate custom policy reforms: https://policyengine.org/uk https://policyengine.org/uk
- nly 4y agoThe thing I find interesting is Americans always claim that countries with socialised healthcare have significantly higher tax burdens, but if you compare take home salaries between say New York and London, or San Fransisco and London, they're not that far apart. 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...
- n4r9 4y ago> Americans always claim that countries with socialised healthcare have significantly higher tax burdens 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).
- ameister14 4y agoAgreed. US also doesn't have VAT, though, which makes a fair bit of difference. State sales taxes vary but the highest is less than half the British VAT. Individual Income taxes are what, 25-30% of total tax revenue in the UK? I know OECD average is 25%. It's about 42% in the US.
- petercooper 4y agoThe other thing that's interesting is if you ignore private payments to healthcare entirely, the US still spends more per capita from the public purse on healthcare than the UK does. So the US pays a ton of public money and yet most of the population still gets nothing unless they pay even more.
- omarish 4y agoThis is really cool.. nicely done @tmm1. I've been meaning to dig into WASM and this is even more reason to do so.
- FullyFunctional 4y agoThat's brilliant work, thanks! Imagine if IRS would produce something like this (open sourced) and we could file our returns like this.
- ErikVandeWater 4y agoThe IRS can already calculate your taxes for you. In other countries you just have to confirm what the revenue department calculates as your liability and hit "submit". You have to do the calculations yourself because TurboTax et al., and accountants lobbied so taxes are complicated and must be completed by the filer (or their accountant).
- tmm1 4y agoFrom the abstract of NBER paper I mentioned [1]: > 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/w30008.pdf https://www.nber.org/system/files/working_papers/w30008/w300...
- sokoloff 4y agoOne problem is that information is not tabulated by the IRS in time for a mid-April return date. Order your tax “transcript of account” in late March and again in late August. It’ll be substantially more complete in late August.
- FullyFunctional 4y ago
- thatfrenchguy 4y agoWhy a 500k$ wages/salaries limit here? :)
- brianmario 4y agoYou can use the gear icon in the upper right to turn the sliders into text boxes.
- thatfrenchguy 4y agoah thank you :)
- randomhodler84 4y ago“640K ought to be enough for anybody“
- jdasdf 4y agoIt's all blank for me
- jrockway 4y agoThis is very interesting. I learned that the last year I made enough money to pay AMT is the year they got rid of AMT. Damn!
- PopAlongKid 4y agoNo one "got rid" of AMT, it is still alive and well in both the federal tax code and some states, such as California. 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.
- HWR_14 4y ago> no mortgage interest deduction for equity debt Wait, what? When did that happen? And did the "for equity debt" mean that it still applies to houses?
- PopAlongKid 4y agoTo clarify, these are technical terms for income tax purposes, and are not defined by any label a bank may put on a loan, such as "HELOC" (home equity line of credit). 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.
- HWR_14 4y agoThanks. 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).
- thechao 4y agoWhy is the income limited to 500000$?
- KerrAvon 4y agoI wish this would get written up in mainstream media. Hypothesis being that if more people knew this existed, it would put additional pressure on Congress to simplify tax filing.
- divbzero 4y agoThe number of possible inputs for Income is stunning: 15 types of income in total. 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
- m0llusk 4y agoPotentially interesting to note that the home mortgage interest and state tax deductions were long controversial as perverse incentives and got dropped during the Trump administration.
- lotsofpulp 4y agoBecause standard deduction is so high now, 90% of US tax filers do not have to worry about itemizing. According to IRS stats website, which I do not have handy on my phone.
- throwaway2037 4y agoHat tip on the reference. I didn't consider the effect. I found an article about it here: https://taxfoundation.org/standard-deduction-itemized-deductions-current-law-2019/ https://taxfoundation.org/standard-deduction-itemized-deduct...
- physicsguy 4y agoThis is kind of mental. In the UK we have nowhere near as many tax deductible things. An ordinary employed person will only ever get tax deductions for pension contributions or charitable donations. Almost nobody in the UK even has to file a tax return; data is returned automatically to the government by all employers and so there is no need unless you have certain uncommon circumstances. 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.
- keehun 4y agoAre all the dollar amounts in the simulated tax output at the top of the page inflation adjusted? 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?
- nicoburns 4y agoA quick google shows that yes, there was a 70% marginal tax rate (applying to income over $108,300 - not inflation adjusted - for a single filer) as recently as 1981 https://taxfoundation.org/historical-income-tax-rates-brackets/ https://taxfoundation.org/historical-income-tax-rates-bracke...
- sgjohnson 4y agoBut nobody ever paid it as there were millions of loopholes.
- thnujmikkkk 4y agosource?
- deleted 4y ago[deleted]
- standardUser 4y agoYou have to be actually wealthy for most "loopholes" come into play. Just like today, non-wealthy high earners take the biggest hit in taxes. And there are way more of those than actually wealthy people. Back then, the hit was even bigger, but the group being hit the hardest was smaller. 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.
- refurb 4y ago
- tick_tock_tick 4y agoThis seems beyond misleading it doesn't even have a method to enter most of the now illegal methods to lower your tax bill. Tax straddles were only banned in 1977 before that you should have easily been able to more then halve your tax bill with futures.
- thelamest 4y agoDoesn’t this fit into “other adjustments”? Net operating loss is listed among the examples there.
- divbzero 4y agoTax straddles—now illegal—is a new concept to me. A couple old articles about it from New York Times: Looking for Tax Losses in Commodities (1977) https://www.nytimes.com/1977/12/11/archives/investing-looking-for-tax-losses-in-commodities.html 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-straddles.html https://www.nytimes.com/1982/03/10/business/irs-wins-on-tax-...
- yieldcrv 4y agoInteresting, this is probably why I never heard of straddles in a futures context 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
- mywittyname 4y agoI've never heard of tax straddles, but they sound an awful lot like what we now call "tax loss harvesting." > 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.
- brewdad 4y ago
- divbzero 4y agoThis is great. I would also love to see a graph of the federal tax over time from 1960 to today.
- dmtroyer 4y agocome again?
- forrestthewoods 4y agoThis is great. Could you add a box that displays effective tax rate and marginal rate? 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.
- minhazm 4y agoThis calculator doesn't seem to support local income taxes, which many states have [1]. For example Maryland has income tax brackets than other states, but each county levies its own income tax on top of that. I usually use smartasset's income tax calculator [2], which also asks for your location so it can factor in any local income taxes as needed. [1] https://www.thebalance.com/cities-that-levy-income-taxes-3193246 https://www.thebalance.com/cities-that-levy-income-taxes-319... [2] https://smartasset.com/taxes/income-taxes https://smartasset.com/taxes/income-taxes
- MaxGhenis 4y agoSmartAsset is only a rough approximation based on standard deductions/exemptions and the rate structure. It excludes tax credits and other provisions that make taxsim much more accurate, especially for low-income households.
- minhazm 4y agoBut again taxsim is missing local income taxes entirely. That makes it automatically inaccurate for millions of people. Smart Asset is an estimate but it's at least accurate for the cases that it covers and doesn't claim to be a complete tax calculator. 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.
- MaxGhenis 4y agoFWIW, we'll have Maryland income taxes, including local income taxes, by the end of July: https://github.com/policyengine/openfisca-us https://github.com/policyengine/openfisca-us
- ideamotor 4y agoThis is amazing. Would there be a way to estimate future year taxes? For example, knowing past years inflation numbers could you run possible scenarios of future tax brackets? 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-adjustments-for-tax-year-2022 https://www.irs.gov/newsroom/irs-provides-tax-inflation-adju... (I’m uncertain whether this is based on some predetermined formula)
- PopAlongKid 4y ago>Would there be a way to estimate future year taxes? 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).
- ideamotor 4y agoWell I’m not looking for 100% accuracy, and it doesn’t need to cover all types of income. I’m interested in long term investment income with various input types of accounts and investments given different inflation and tax policy scenarios. It just needs to be better than the software I’ve seen which is basically trash (assumes a flat percent tax).
- MaxGhenis 4y agoFantastic job making taxsim more accessible! We've built an open-source version of taxsim called OpenFisca US [1] which we expose in our (also open-source) web app, PolicyEngine US [2]. We haven't yet implemented all of taxsim—we only have the most recent couple of years, and not all states—but we have some advantages like implementing means-tested benefits and being able to simulate custom tax and benefit reforms, both on individuals and the population (e.g. the budgetary and poverty impacts). I'd love to get in touch. Will email you from max@policyengine.org. [1] https://github.com/policyengine/openfisca-us https://github.com/policyengine/openfisca-us [2] https://policyengine.org/us https://policyengine.org/us
- aidangrimshaw 4y agoSort of tangentially, I'm working with other contributors on https://ustaxes.org https://ustaxes.org, an open source tax filing webapp https://github.com/ustaxes/UsTaxes https://github.com/ustaxes/UsTaxes. 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!
- dhosek 4y agoWhen you say “filing” does this mean it actually electronically file the return or it just is able to print out the returns for sending in by post?
- aidangrimshaw 4y agoIt calculates the tax amounts and fills them into the IRS and state forms to be printed out
- raptortech 4y agoThis is awesome! Two features requests: 1. A plot over time 2. Could you adjust the income for inflation, so when you click back 1yr your income goes down accordingly?
- mNovak 4y agoCool use of emscripten. Is this handling inflation at all? Fixed-number items like standard deduction will be impacted by that. 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.
- mgarfias 4y agoBADASS THANK YOU
- emmelaich 4y agoI wonder whether it would be easier to get Fortran in the browser with f2c (http://www.netlib.org/f2c/ http://www.netlib.org/f2c/) then C to WASM. I had excellent results with f2c on an old Fortran program when I used it.
- tmm1 4y agoThanks for sharing this! I tried it and indeed it works quite well. This will be much simpler/easier than gfortran+dragonegg, and removes some roadblocks preventing me from using the latest emscripten/llvm.
- novok 4y agoIs there an option to add some cities or counties, like new york city's local tax?
- lettergram 4y agoThe tax is not accurate historically, for higher income brackets. Prior to 2018(?) you could deduct the majority of your state income tax from the federal income tax (the "Trump tax cuts"). https://nypost.com/2021/10/05/court-upholds-trump-law-limiting-state-tax-deductions/ https://nypost.com/2021/10/05/court-upholds-trump-law-limiti... Basically, prior to that implementation, you were really paying MAX(federal income tax, state income tax). After that implementation, you could only deduct a maximum of $10,000 in state income tax from federal tax. So it looks more like: ADD(federal income tax - $10,000, state income tax)
- mrunkel 4y agoI don't believe you're calculating the pre law change correctly. You could deduct your state tax from your income for federal tax purposes. So if you made 100k and paid 17k in state taxes, your federal AGI was 83k. Post change, it would have been 90k. The Trump era change was really a fuck you to high earners in states with high taxes. Shockingly, a majority of those people tended to vote for the Democratic Party.
- thelamest 4y agoFunnily enough, that SALT deduction was disliked by economists, as regressive, inefficient and mostly pointless. It was bashed by policy think tanks from all sides, e.g. Brookings, CRFB, Heritage, CBPP, and Center for American Progress.
- Aeolun 4y agoMy tax was 50% higher in 1988 than in 2020. Did taxes really come down to this extend over the past 30 years?
- onlyrealcuzzo 4y agoHistorically, taxes fluctuated quite a bit. IIUC, income taxes have been unusually stable the last ~20 years.
- 1270018080 4y agoA slider for inputting multi digit numbers? Pain.
- meter 4y agoI was curious to see how many kids it would take to lower my taxes to zero. Apparently, you’re not allowed to have more than 15 dependents.
- cyrusthegreat 4y agoThis is awesome! Permanently bookmarked!
- bradgessler 4y agoThis is great! If you’re taking feature requests I’d love to see a bar or line chart showing the amount of taxes paid for the Y axis and year on the X axis. Would make comparing over time much easier.
- interblag 4y agoBit late to the party but I just wanted to put one top level comment saying: this is awesome! I'd never have thought that putting a Fortran codebase like this into WASM was so possible. And doing so in this way surfaces great, battle-tested information, that would be herculean to reimplement and test in another language. Really awesome stuff!
- ngcc_hk 4y agoI may be confused. I just talked with my kids about the problem of maintaining some old program in us gov particularly related to taxation. Possibly in assembly and last attempt to upgrade run out of budget and hence USA gov will forever have issue in maintaining it. People knew left and good luck to find my kid generation to learn those old thing. Can you do it the other way round I wonder? Just give up and use a new version and ask legal to send this open source to all agents. After 3 years day this is the version. It is not a sim issue. It is not a pre-filled issue. It is a real issue. Or my brief to my kid is wrong. It is about something else.
- madsbuch 4y agoAs a Danish person, it is a fun tool to play around with! Discovering that the tax difference between the US and Denmark is close to negligible is interesting as we have been known to have a high tax burden in Denmark.
- zild3d 4y agoWas hoping it would adjust today's income for inflation going back with a chart over time
- idomi 4y agoHow is this different than turbotax for instance?
- taxman135 4y agoThe child tax credit calculation is incorrect for 2022+ It should not phase out at 150,000 anymore, but rather starting at 200,000 for single or 400,000 for married filing jointly. Ref: https://sgp.fas.org/crs/misc/IF11077.pdf https://sgp.fas.org/crs/misc/IF11077.pdf
- guiltygods 4y agoThis is really great. Can you please add Net Income after calculation. That would be useful.