Lurker News
I wanted to share a simple web app I created recently, which lets you estimate income taxes owed in the US: 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, 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
[2] https://taxsim.nber.org/
[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/
[6] https://github.com/tmm1/taxsim.app
[7] https://github.com/shanejorr/usincometaxes/pull/11

Comments (155) 41 threads

Earlier comments
ngcc_hk#
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.

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.

forrestthewoods#
This 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.

CSMastermind#
Would 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.

taxman135#
The 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

Load more comments