I wanted to share a simple web app I created recently, which lets you estimate income taxes owed in the US: <a href="https://taxsim.app" rel="nofollow">https://taxsim.app</a><p>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.<p>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].<p>This WASM build now powers <a href="https://taxsim.app" rel="nofollow">https://taxsim.app</a>, 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].<p>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.<p>[1] <a href="https://taxsim.nber.org/feenberg-coutts.pdf" rel="nofollow">https://taxsim.nber.org/feenberg-coutts.pdf</a><p>[2] <a href="https://taxsim.nber.org/" rel="nofollow">https://taxsim.nber.org/</a><p>[3] <a href="https://www.nber.org/papers/w30008" rel="nofollow">https://www.nber.org/papers/w30008</a><p>[4] <a href="https://github.com/tmm1/taxsim.js" rel="nofollow">https://github.com/tmm1/taxsim.js</a><p>[5] <a href="https://chrz.de/2020/04/21/fortran-in-the-browser/" rel="nofollow">https://chrz.de/2020/04/21/fortran-in-the-browser/</a><p>[6] <a href="https://github.com/tmm1/taxsim.app" rel="nofollow">https://github.com/tmm1/taxsim.app</a><p>[7] <a href="https://github.com/shanejorr/usincometaxes/pull/11" rel="nofollow">https://github.com/shanejorr/usincometaxes/pull/11</a>
Fantastic 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).<p>I'd love to get in touch. Will email you from max@policyengine.org.<p>[1] <a href="https://github.com/policyengine/openfisca-us" rel="nofollow">https://github.com/policyengine/openfisca-us</a><p>[2] <a href="https://policyengine.org/us" rel="nofollow">https://policyengine.org/us</a>
Are all the dollar amounts in the simulated tax output at the top of the page inflation adjusted?<p>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?<p>Tangentially, did federal taxes really come down that much?
This seems beyond misleading it doesn't even have a method to enter most of the now illegal methods to lower your tax bill.<p>Tax straddles were only banned in 1977 before that you should have easily been able to more then halve your tax bill with futures.
Very cool, especially hearing about the implementation.<p>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.
I 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.
The US personal tax code looks extremely complicated to British eyes, but British people have a similar calculator at their disposal at <a href="https://listentotaxman.com/" rel="nofollow">https://listentotaxman.com/</a> though it only goes back to 2000.
I wonder whether it would be easier to get Fortran in the browser with f2c (<a href="http://www.netlib.org/f2c/" rel="nofollow">http://www.netlib.org/f2c/</a>) then C to WASM.<p>I had excellent results with f2c on an old Fortran program when I used it.
As 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.
This 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?<p>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.<p>1: <a href="https://www.irs.gov/newsroom/irs-provides-tax-inflation-adjustments-for-tax-year-2022" rel="nofollow">https://www.irs.gov/newsroom/irs-provides-tax-inflation-adju...</a> (I’m uncertain whether this is based on some predetermined formula)
Sort of tangentially, I'm working with other contributors on <a href="https://ustaxes.org" rel="nofollow">https://ustaxes.org</a>, an open source tax filing webapp <a href="https://github.com/ustaxes/UsTaxes" rel="nofollow">https://github.com/ustaxes/UsTaxes</a>.<p>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!
Didn’t take a close look but the 1986 (?) tax code update close major tax avoidance pathways (passive loses and tax shelters in wiki link).<p>I think one issue with calculators like this is it doesn’t account for excluding revenue that now has to be included.<p><a href="https://en.m.wikipedia.org/wiki/Tax_Reform_Act_of_1986" rel="nofollow">https://en.m.wikipedia.org/wiki/Tax_Reform_Act_of_1986</a>
Bit 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!
The 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").<p><a href="https://nypost.com/2021/10/05/court-upholds-trump-law-limiting-state-tax-deductions/" rel="nofollow">https://nypost.com/2021/10/05/court-upholds-trump-law-limiti...</a><p>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)
I 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.<p>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.<p>It is not a sim issue. It is not a pre-filled issue. It is a real issue.<p>Or my brief to my kid is wrong. It is about something else.
This is great. Could you add a box that displays effective tax rate and marginal rate?<p>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.
Would be helpful if there was a way to see a graph of how the amounts change over time.<p>I find myself putting in my info and then click minus on the years to see how the years change.
The child tax credit calculation is incorrect for 2022+<p>It should not phase out at 150,000 anymore, but rather starting at 200,000 for single or 400,000 for married filing jointly.<p>Ref: <a href="https://sgp.fas.org/crs/misc/IF11077.pdf" rel="nofollow">https://sgp.fas.org/crs/misc/IF11077.pdf</a>
Cool use of emscripten. Is this handling inflation at all? Fixed-number items like standard deduction will be impacted by that.<p>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.
This is great!<p>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.
This 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.<p>[1] <a href="https://www.thebalance.com/cities-that-levy-income-taxes-3193246" rel="nofollow">https://www.thebalance.com/cities-that-levy-income-taxes-319...</a>
[2] <a href="https://smartasset.com/taxes/income-taxes" rel="nofollow">https://smartasset.com/taxes/income-taxes</a>
This is awesome! Two features requests:<p>1. A plot over time<p>2. Could you adjust the income for inflation, so when you click back 1yr your income goes down accordingly?