Show HN: Calculator for US individual income tax, from 1970-present
497 pointsAll 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
Show all comments
Showing thread 9 of 41
Imagine 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.
Continue this thread — 1 reply
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
Continue this thread — 1 reply
(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.